[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gettext] English fallback bug on macOS.
From: |
Nate Weaver |
Subject: |
[bug-gettext] English fallback bug on macOS. |
Date: |
Tue, 15 Jan 2019 10:52:10 -0600 |
Hello,
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!
--Nate Weaver (Wevah)
- [bug-gettext] English fallback bug on macOS.,
Nate Weaver <=