Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: RFC PATCH: stop lowercasing messages from strerror



On Wed, Nov 18, 2026 at 6:50 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> Mikael Magnusson wrote on Tue, 17 Nov 2026 11:49 +00:00:
> > Originally reported in debian bug 419233 and forwarded as workers/23274.
> >
> > ---
> >
> >> It's not a uniform standard in English, even taking away the technical
> >> issues (i.e. it's not simply a kludge in Bash), so from the language
> >> point of view I don't think there's any problem in changing it.
> >>
> >> The issue is likely to be people matching on error messages in tests ---
>
> Fair point.  However, people having to update their tests is a one-time
> cost, and by incurring it we align zsh's behaviour from here on with
> most other tools' behaviour and, I therefore suspect, most people's
> expectations.
>
> Also, blindly lowercasing a word can change its meaning (e.g.,
> "Polish", "Bob", [whatever the codename of the latest Ubuntu is]), so we
> shouldn't do that.
>
> Also, this lowercasing can create misspellings in English too — e.g.,
> when the message starts with an acronym:
> .
>     % errno -l | perl -anE 'say "@F" if $F[2] =~ /^[A-Z][A-Z]/'
>     EDOTDOT 73 RFS specific error
>     %
> .
> We shouldn't print "rFS specific error".

Right, this is presumably why the existing code special cases EIO :).
(Though a slightly less(?) fragile special case would be to check if
the second character is also uppercased).

> >> which could happen in other languages with Latin character sets, so
> >> specialising English isn't a fix.  I have absolutely no idea how common
> >> this would turn out to be.  I think we'd have to apply the patch and ask
> >> people to look for knock-on effects.
> >
> > Here's a patch against the current code, including adjustments for our
> > own tests, for reference.
> >
> > It would have been nice if strerror returned text in lower case, since
> > uppercasing is somewhat less problematic, but I suppose it's a bit late
> > to lobby for that.
> >
> > I also realized that my consistency argument somewhat falls on the fact
> > that every other error message in zsh is still printed in lower case :).
> >
>
> > Even if we decide to keep the lowercasing, it should probably at least
> > be made to work on multibyte text, or perhaps we should just use
> > strerror_l when it exists (since POSIX.1-2008 if my manpage is to be
> > believed) with a "C" locale so that all error messages are in english,
> > since our other messages aren't translated anyway?
>
> I would expect someone who runs with LC_MESSAGES=foo to prefer "some
> messages are in foo and some are untranslated" to "all messages are untranslated".
>
> Besides, even programs that do localize their messages still print
> unlocalized messages when a particular message hasn't been translated;
> i.e., it's not unheard of to see a bit of English in the middle of an
> otherwise-localized session.

This was my original instinct, but then I got a bit unsure, thanks for
reassuring me :). (I take it your overall view is the patch as I
posted it is reasonable).

-- 
Mikael Magnusson




Messages sorted by: Reverse Date, Date, Thread, Author