4

I've been trying to change GNUCash UI language as it's described here: Link

...by running the following command in the terminal:

LANGUAGE=ar_SY LANG=ar_SY gnucash

But it returned the following:

The locale defined in the environment isn't supported. Falling back to the 'C' (US English) locale

Any solution please?

I think there must be a general way to run a GTK application with a specific language.

Dejan Skledar
  • 11,280
  • 7
  • 44
  • 70
Anas R.
  • 357
  • 5
  • 15
  • 1
    Did you try (as suggested) the `ar_SY.UTF-8` locale? – ntd May 03 '15 at 07:17
  • Yes, it works now, but Arabic texts appear LTR, not RTL. I used to think GTK is smart enough to display Arabic texts in RTL direction. – Anas R. May 03 '15 at 09:24
  • AFAIK GTK+ has full bidirectional support. I have also seen screenshots with RTL and LTR text mixed together but my knowledge on this area pretty much ends here. – ntd May 03 '15 at 11:11

3 Answers3

4

tl;dr:

$ LANGUAGE=nl_NL.UTF-8 LANG=nl_NL.UTF-8 LC_ALL=nl_NL.UTF-8 gnucash

(change into the locale codes of your choice)


I know I'm a bit late to the game, but I was also running into issues with languages.

As an extra, I really want to keep my system locale at en_C.UTF-8 / C because the Dutch language prescribes a comma for decimal separator and completely messes with day-to-day programming tasks (especially in LibreOffice). So I need GnuCash to run in 'translation mode'.

Anyway, running

$ LANGUAGE=nl_NL.UTF-8 LANG=nl_NL.UTF-8 gnucash

did not work for me either (just runs in English). Then, I found this link (accessed on Aug 19, 2015) about locale settings in GnuCash.

In the section 'OS dependend tweaking', at the end of the 'Changing the Language on Linux' sub-section, they hinted to also specify the LC_ALL environment variable:

If you can get the graphical interface in the correct language , but you can't get the accounts in the desired locale, you have to add the LC_ALL variable, like in the following example:

LANG=it_IT.UTF-8 LANGUAGE=it_IT.UTF8 LC_ALL=it_IT.UTF-8 gnucash

This does the trick for me:

$ LANGUAGE=nl_NL.UTF-8 LANG=nl_NL.UTF-8 LC_ALL=nl_NL.UTF-8 gnucash

Perhaps this might work for you:

$ LANGUAGE=ar_SY LANG=ar_SY LC_ALL=ar_SY gnucash
Community
  • 1
  • 1
Marten Koetsier
  • 3,389
  • 2
  • 25
  • 36
  • Perhaps you also need to add the `.UTF-8` suffix. Check the output of `$ locale -a` for available locales. – Marten Koetsier Aug 21 '15 at 07:27
  • That works, how can I tell it the desktop if I want to click the icon for the flatpak installed app? – Max N Mar 01 '22 at 14:21
  • 1
    @MaxN Most denktop environments allow you to define the command executed for each 'icon' or 'shortcut'. Usually, right-click for contect menu and edit the properties. There you should be able to add the environment variables. If you run into issues, it's best to ask a new question (perhaps even on superuser). – Marten Koetsier Mar 02 '22 at 15:22
1

There might be a problem in the .po translation files. In that file, the direction should be defined according to this article.

jcoppens
  • 5,306
  • 6
  • 27
  • 47
  • It works fine now. I just made a link of `/usr/share/locale/ar/LC_MESSAGES/gtk30.mo` file called `gtk2.0.mo` in the same directory. – Anas R. May 04 '15 at 09:22
0

If anybody is interested, a solution that can be used on Mac OS X (Yosemite) is to add these lines in Gnucash (in this case for Italian):

export LANG=it_IT.UTF-8
export LANGUAGE=it_IT.UTF-8
export LC_ALL=it_IT.UTF-8

Following the advice on the above metioned link, these three lines should be added just above this part:

$EXEC "$bundle_contents/MacOS/$name-bin" $* $EXTRA_ARGS

Gnucash is an executable file located inside Gnucash.app that is present in your Applications folder (you should see Gnucash without .app extension). If you select it and in the dropdown menu you click on "Show Package Contents", you will find the Gnucash executable file in /Contents/MacOS folder. You can then modify the file with your preferred text editor.

Michele
  • 111
  • 6