Mac OS X: Fails to get locale in Japanese

Bug #476678 reported by Masato HASHIMOTO
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
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).

Tags: osx ui

Related branches

su_v (suv-lp)
tags: added: osx ui
Revision history for this message
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.

Revision history for this message
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...

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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.

Revision history for this message
Shrimp Salad (shrimpseaweed) wrote :

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

Revision history for this message
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.

Revision history for this message
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)
Changed in inkscape:
status: New → In Progress
Revision history for this message
Qantas94Heavy (qantas94heavy) wrote :

Assuming fixed. If this is still an issue, please check if it has been reported here: https://inkscape.org/inbox

Closed by: https://gitlab.com/Qantas94Heavy

Changed in inkscape:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.