[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gettext] English fallback bug on macOS.
From: |
Nate Weaver |
Subject: |
Re: [bug-gettext] English fallback bug on macOS. |
Date: |
Tue, 15 Jan 2019 13:02:52 -0600 |
> On Jan 15, 2019, at 12:28:11, Bruno Haible <address@hidden> wrote:
>
> 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
>
Ah, thanks!