bugPSPP - Bugs: bug #58537, MacOS: Default Language settings...

 
 

bug #58537: MacOS: Default Language settings are not honored (gettext problem)

Submitted by:  Friedrich Beckmann <beckmanf>
Submitted on:  Wed 10 Jun 2020 10:45:07 AM UTC  
 
Category:  Internationalization/Localization Severity:  5 - Average
Status:  Wont Fix Assigned to:  Friedrich Beckmann <beckmanf>
Open/Closed:  Closed Release:  None
Effort:  0.00

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 17 Jun 2020 06:15:06 PM UTC, comment #2: 

This bug is in gettext and has already been fixed.
The bug only manifests itself on MacOS.

So the onus is on the MacOS packagers, either to recent gettext, or to work around the bug some other way.

It seems there is nothing for us to do here.

John Darrington <jmd>
Project Administrator
Thu 11 Jun 2020 08:40:14 AM UTC, comment #1: 

The update to gettext 0.20.2 in macports is addressed here:

https://trac.macports.org/ticket/58526

Friedrich Beckmann <beckmanf>
Project MemberIn charge of this item.
Wed 10 Jun 2020 10:45:07 AM UTC, original submission:  

Wan Howe Chern reported a bug regarding a wrong language setting in
pspp in the mailing list

https://lists.gnu.org/archive/html/bug-gnu-pspp/2020-06/msg00028.html

The selected language on his Mac is english but pspp shows japanese. I can confirm the bug on my Mac running 10.13.6 where I added english as preferred first language to the previous german language. The gui still opens in german when clicking the application bundle. When I start psppire from the terminal, then it depends on the environment variable settings in the terminal.

When I check in the terminal settings "Preferences->Profiles->Advanced" the check box "Set locale environment variables on startup", then I see the following variables in the terminal:

Fredo:~ fritz$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
Fredo:~ fritz$

i.e. the language setting variables are set and they are based on the current setting in MacOS. When I start psppire in the terminal, then these variables are honored and the gui opens in english as expected.

When I disable the terminal settings such that locale gives

Fredo:~ fritz$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
Fredo:~ fritz$

then the psppire gui will startup with the german language (which I have as second language). So when the environment variables for language are set, then everything works as expected.

Starting pspp in the application bundle obviously has not set these variables and the language settings are retrieved by some operating system calls in the application. I added some calls to figure that out in i18n_init

void
i18n_init (void)
{
  char *loc = setlocale (LC_ALL, NULL);
  printf ("locale %s, test: %s\n", loc, _("Help"));
  setlocale (LC_ALL, "");
  bindtextdomain (PACKAGE, relocate(locale_dir));
  textdomain (PACKAGE);
  loc = setlocale (LC_ALL, NULL);
  printf ("locale %s, test %s\n", loc, _("Help"));
  loc = gettext("Help");
  printf ("localename %s\n",loc);

which results in the following output

Fredo:build fritz$ ../osxbundler/install/bin/psppire
locale en_US, test: Help
locale en_US, test Hilfe
localename Hilfe

So the language settings are correctly identified as en_US but the gettext function insists on the german language after initialization of the gettext system. It turns out that this bug is in the gettext system and it has been reported and fixed

https://savannah.gnu.org/bugs/?49560

The bug is fixed in the gettext 0.20 release. The initial bug report including patch is from 2016. I use the macports system which as of today has the 0.19.8.1 version of gettext.

https://ports.macports.org/port/gettext/summary

I think this is only a problem when you add english as additional language but you have installed another language (like japanese or german) as a second choice. I have not tested to completely remove the german language from MacOS language settings. Maybe this is also a workaround.

Workaround: Start psppire from the terminal with the LC_ALL variable set.

So this bug is not related to pspp but to the gettext library (libintl). When I run with gettext 0.20.2, then this bug is gone. But I need to convince the macports friends to update the gettext library. The current bundle has the 0.19.8.1 version with the bug.

Thanks for reporting the bug.

 
Friedrich Beckmann <beckmanf>
Project MemberIn charge of this item.

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jmd (Posted a comment)
  • -email is unavailable- added by beckmanf (Submitted the item)
  • -email is unavailable- added by beckmanf
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-17 jmd StatusIn Progress => Wont Fix
        Open/ClosedOpen => Closed
    2020-06-10 beckmanf Carbon-Copy- => Added howechern@gmail.com

    Back to the top


    Powered by Savane 3.6