Mac OS X: Fails to get locale in Japanese

Bug #476678 reported by Masato HASHIMOTO on 2009-11-06
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Undecided
Unassigned

Bug Description

Sorry, I don't use Mac but this issue seems to be well known in Japanese users.
By default, Inkscape (0.47 and older) fails to get locale in Japanese (ja_JP.UTF-8) so English interface appears.
After changing language in Inkscape preference in 0.47, ja interface is displayed properly.

Currently (by 0.46), almost Mac users edit /Applications/Inkscape.app/Contents/Resources/bin/inkscape to solve it (set 'export LANG=ja_JP.UTF-8') or use Japanized version distributed by one (some) mac user(s).

Related branches

su_v (suv-lp) on 2009-11-06
tags: added: osx ui
su_v (suv-lp) wrote :

Related earlier reports:
Bug #167486 “Spanish on osx” (Fix released)
Bug #167849 “Localisation of UI unavailable on MacOS X” (Fix released)
Bug #349825 “Download Current Mac Version is French Only!” (Incomplete)
Bug #360317 “Brazilian localization don't launch!” (Incomplete)

A different language selection mechanism is described in:
Bug #242105 “Versión en Español para Mac” (Fix committed)
If this solution works for all localizations, one could update the packages to include an empty directory 'Contents/Resources/ja.lprj' or similar.

su_v (suv-lp) wrote :

The current language selection script in 'Contents/Resources/bin/inkscape' doesn't reliably retrieve a valid value for $LANG. Some time ago I had tried to find a better solution by adding
a) parsing the OSX user preference 'AppleLanguages' (user preference for general ui language)
b) looking up that string in '/usr/X11/share/X11/locale/locale.alias' instead of '/usr/share/locale/locale.alias'

I never tested the script outside my local setup (basically en_US (keyboard de_CH) and a few test-runs with other latin1 languages that are part of the default OS X Leopard installation) - I am using it though with my current SVN builds. If anyone wants to pick up from here...

su_v (suv-lp) wrote :
Masato HASHIMOTO (hashimo) wrote :

One ja mac user run get_LANG.sh. The result was as follows:

 Setting Language: ja_JP.UTF-8

He(She) said that the script gets locale from X11 setting.

Koichi Hyodo (siorhto+inkspace) wrote :

Inkscape 0.48
MacOSX 10.6.4

I agree original Contents/Resources/bin/inkscape cannot get locale in Japanese.
The reason of it, I think, /usr/share/locale/locale.alias in MacOSX has some unexpected values.

japanese ja_JP.eucJP
japanese.euc ja_JP.eucJP
ja_JP ja_JP.eucJP
ja_JP.ujis ja_JP.eucJP
japanese.sjis ja_JP.SJIS

korean ko_KR.eucKR
korean.euc ko_KR.eucKR
ko_KR ko_KR.eucKR

no_NO nb_NO.ISO-8859-1
no_NO.ISO-8859-1 nb_NO.ISO-8859-1

The original shell script try to get locale as follows:

     tail -n1 | sed 's/¥./ /' | awk '{print $2}

But it fails to get proper value 'ja_JP'. It got wrong string 'sjis' on my Mac,
In Japanese, grep & tail brings a line that has unexpected 'dot', and 'sed' works in bad timing.

I have tried to repair it, and it is the same sentence as suv's get_LANG.sh

     tail -n1 | awk '{print $2}' | sed 's/¥./ /' | awk '{print $1}'

It works well without '/usr/X11/share/X11/locale/locale.alias'.

ps.
The result of running get_LANG was as follows:

Setting Language: ja_JP.UTF-8

Koichi Hyodo (siorhto+inkspace) wrote :

Ah... sorry

X: It works well without '/usr/X11/share/X11/locale/locale.alias'.
O: This code works well without any other changes.

Shrimp Salad (shrimpseaweed) wrote :

This bug still remains on ver.0.91, so please apply this change.

Atsuyoshi Suzuki (atuyosi) wrote :

I have checked version 0.92pre2 source code, but this bug still remains.

Why don't this bug fix?

Please apply Hyodo's change.

In source tree: 'packaging/macosx/Resources/bin/inkscape' (line 143)

(/Applications/Inkscape.app/Contents/Resources/bin/inkscape)

Thanks.

Tim Sheridan (tghs) wrote :

I've tested and committed Koichi Hyodo's change, as suggested by Atsuyoshi Suzuki in my branch targeting 0.92.2:

http://bazaar.launchpad.net/~tghs/inkscape/0.92.x_mac_packaging/revision/15381

Tim Sheridan (tghs) on 2017-02-25
Changed in inkscape:
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions

Bug attachments