bugGNU gettext - Bugs: bug #49560, [PATCH]...


You are not allowed to post comments on this tracker with your current authentication level.

bug #49560: [PATCH] _nl_language_preferences_default needs updating for macOS Sierra (10.12)

Submitted by:  Kristian Rietveld <krietvel>
Submitted on:  Tue 08 Nov 2016 08:01:46 PM UTC  
Category:  End-user / runtime Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Bruno Haible <haible>
Open/Closed:  Closed

Thu 09 May 2019 07:24:46 PM UTC, comment #2: 

The fix is contained in the gettext-0.20 release.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sun 16 Sep 2018 02:58:52 AM UTC, comment #1: 

Thanks for the report and problem analysis.

It's fixed through https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=aeab87f30d60f17817477901672bcd20083ea2a3

In your patch, you test against "en-". But since the previous call nl_locale_name_canonicalize (buf) converts "en-CC" to "en_CC", I had to test against "en" instead.

Also, For most of the combinations, such as "de_US", "en_DE", etc. no translations are available. To make use of existing translations, I convert "ll-CC" not only to "ll_CC" but to "ll_CC:ll".

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Tue 08 Nov 2016 08:01:46 PM UTC, original submission:  

_nl_language_preferences_default() (in gettext-runtime/intl/langprefs.c) has a special implementation for macOS. In this function all preferred languages as configured in the Operating System are iterated. As soon as the English language is detected, the iteration is stopped and no further languages are considered. This is because many GNU programs don't ship an en.mo catalog.

The problem is that detection of the English language is no longer working properly on macOS Sierra (10.12), causing preferred languages with a lower priority than English to be considered. This problem has been reported numerous times in the GIMP bug tracker (see https://bugzilla.gnome.org/show_bug.cgi?id=770708).

The attached patch solves the problem. (Although the patch is not against the most recent release of gettext, the code in git HEAD also shows this problem).

Before Sierra, preferred languages were listed as:


Starting with Sierra, this has changed to:


which is way modification of the string comparison is required. This change is elaborated in the following Apple TechNote: https://developer.apple.com/library/content/technotes/tn2418/_index.html

Kristian Rietveld <krietvel>


Attached Files
file #38908:  gettext-fix-English-language-fallback-for-macOS-Sierra.patch added by krietvel (1KiB - application/octet-stream - Proposed patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by apjanke (Adding self to Cc list, since I'm watching how this affects Git and qterminal)
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by krietvel (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-22 apjanke Carbon-Copy- => Added floss@apjanke.net
    2018-09-16 haible StatusNone => Fixed
        Assigned toNone => haible
        Open/ClosedOpen => Closed
    2016-11-27 haible CategoryNone => End-user / runtime
    2016-11-08 krietvel Attached File- => Added gettext-fix-English-language-fallback-for-macOS-Sierra.patch, #38908

    Back to the top

    Powered by Savane 3.6