bug-gnu-pspp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PSPP-BUG: [bug #58537] MacOS: Default Language settings are not honored


From: Friedrich Beckmann
Subject: PSPP-BUG: [bug #58537] MacOS: Default Language settings are not honored (gettext problem)
Date: Wed, 10 Jun 2020 06:45:09 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15

URL:
  <https://savannah.gnu.org/bugs/?58537>

                 Summary: MacOS: Default Language settings are not honored
(gettext problem)
                 Project: PSPP
            Submitted by: beckmanf
            Submitted on: Wed 10 Jun 2020 10:45:07 AM UTC
                Category: Internationalization/Localization
                Severity: 5 - Average
                  Status: In Progress
             Assigned to: beckmanf
             Open/Closed: Open
                 Release: None
         Discussion Lock: Any
                  Effort: 0.00

    _______________________________________________________

Details:

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.






 






    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58537>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]