bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] English fallback bug on macOS.


From: Bruno Haible
Subject: Re: [bug-gettext] English fallback bug on macOS.
Date: Tue, 15 Jan 2019 19:28:11 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; )

Hi,

Nate Weaver wrote:
> When LANG (etc.) aren't set, gettext doesn't break early when finding English 
> in the list of preferred languages on macOS; this is because it only checks 
> for the exact string "en" and not a prefix. This worked on older versions of 
> macOS (e.g., 10.2) where the language code set *was* actually just "en", but 
> it breaks on newer versions where the language code is "en-US" or "en-GB" or 
> whatever. This can make things that don't include an english localization 
> file (like Git) display messages in an incorrect language when the language 
> preference order is English -> Other Localized Language (e.g., German or 
> French).
> 
> What fixed it for me (and didn't seem to break other languages), is simply 
> replacing both occurrences of
> 
>     if (strcmp (buf, "en") == 0)
> 
> with
> 
>     if (strncmp (buf, "en", 2) == 0)
> 
> Let me know if you want a patchfile or anything, though I'm sure you won't 
> need one!

Thanks for the report. This is already fixed in the current gettext git
(see https://savannah.gnu.org/bugs/?49560 ), and the fix will be contained
in the next release.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]