Opened 13 years ago

Closed 13 years ago

Last modified 5 years ago

#5831 closed defect (fixed)

MACOSX: Language auto-detection does not work correctly

Reported by: CeRiAl Owned by: criezy
Priority: high Component: Port: Mac OS X
Version: Keywords:
Cc: Game:

Description

It seems that the auto-detection in Mac OS X is not working correctly. Tested on 10.5 (PPC) & 10.7 Intel. Mac OS X GUI is set to german, the environment variable LANG on the shell is set to de_DE.UTF-8

However, when running the scummvm executable direcly from the shell (without wrapping it into a .app) everything works correctly (as LANG is set in this environment). But when running from an .app package it seems that LANG and LC_* are both not set, and setlocate(LC_ALL, "") returns "C" (I have debugged this)

Ticket imported from: #3394080. Ticket imported from: bugs/5831.

Change History (6)

comment:1 by lordhoto, 13 years ago

This might be interesting: http://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPInternational/BPInternational.html#//apple_ref/doc/uid/10000171i

Especially the "Specifying the Supported Localizations in Your Bundle" of http://developer.apple.com/library/iOS/documentation/MacOSX/Conceptual/BPInternational/Articles/ChoosingLocalizations.html

Uneducated guess from a non Mac OS X user: Probably we do not specify what languages we support in our Info.plist file/bundle thus OS X thinks we do not support any localizations and thus sets up the default C locale when one launches the application bundle file. Now don't ask me how to fix this...

comment:2 by digitall, 13 years ago

LordHoto: I looked up the format for CFBundleLocalizations and this looked fairly simple to fix, so I have proceded to add the missing keys in 6b8fb196cbd58e20ef57bf367d5ecbf0ee2ebdad. However, since I am not an OSX user, I have not tested this.

cerial23: This will be included in the next nightly build from: http://buildbot.scummvm.org/builds.html Could you test and confirm if this is fixed?

comment:3 by SF/dominus, 13 years ago

Digitall/tdhs asked me to test it out and unfortunately it still doesn't work (buildbot intel build from the 27th of septembre). I suspect there is something weird going on with OS X and the CFBundleLocalization way to let an app chose its language.

Reasons: - My main machine OS X 10.7 was initially installed in German, later I switched the language to English. Now when I start ScummVM.app I get English > correct. When I start the binary in the bundle the language is German > incorrect. This all NOT affected by what language order I chose in System Preferences->Language & Text->language

BUT when I switch the Region in System Preferences->Language & Text->Formats to United States, ScummVM will be in English once I start the binary in the bundle. And this is regardless whether CFBundleLocalizations array is present in info.plist.

So something is up there and not easily fixed by the CFBundleLocalizations. I only found one other app on my machine with that and it also was controlled by the region and not the language GUI :(

comment:4 by criezy, 13 years ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

comment:5 by criezy, 13 years ago

Listing the localizations in the bundle Info.plist file is only part of the solution. You also need to use that list by calling CFBundleCopyBundleLocalizations() and CFBundleCopyPreferredLocalizationsFromArray(). I have now committed that change and tested that it works on MacOS X 10.6.

comment:6 by digitall, 5 years ago

Component: Port: Mac OS X
Note: See TracTickets for help on using tickets.