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)

Submitter:  Kristian Rietveld <krietvel>
Submitted:  Tue 08 Nov 2016 08:01:46 PM UTC
Votes: 1
 
Category:  End-user / runtime Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Sat 05 Feb 2022 06:38:53 PM UTC, comment #4: 

comment #3:

> comment #2:
> > The fix is contained in the gettext-0.20 release.
>
> Does the patch apply to older gettext versions? MacPorts is stuck on gettext 0.19.8.1 (since updating is difficult), so I was wondering if we could backport the patch to 0.19.8.1 while waiting to figure out how to package 0.21 properly.


Actually never mind; gettext has since been updated in MacPorts, so a backport is now no longer necessary.

Eric Gallager <egallager>
Mon 15 Nov 2021 12:10:41 AM UTC, comment #3: 

comment #2:

> The fix is contained in the gettext-0.20 release.


Does the patch apply to older gettext versions? MacPorts is stuck on gettext 0.19.8.1 (since updating is difficult), so I was wondering if we could backport the patch to 0.19.8.1 while waiting to figure out how to package 0.21 properly.

Eric Gallager <egallager>
Thu 09 May 2019 07:24:46 PM UTC, comment #2: 

The fix is contained in the gettext-0.20 release.

Bruno Haible <haible>
Group administrator
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>
Group administrator
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:

   en
   nl
   de
   es

Starting with Sierra, this has changed to:

   en-CA
   en-GB
   gd-CA
   hi-CA

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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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 egallager (Posted a comment)
  • -email is unavailable- added by egallager (Voted in favor of this item)
  • -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)
  •  

    There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2021-11-15 egallager Carbon-Copy- Added egallager
    2019-04-22 apjanke Carbon-Copy- Added -email is unavailable-
    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.13-4448.
    Corresponding source code