2013-04-08 74 views
2

我有一個擁有日語和英語區域設置的xulrunner應用程序。使用-UILocale <locale>來切換語言環境可以正常工作,因此實際的語言環境文件或代碼沒有問題,但是在日語的計算機上運行應用程序時,它仍然以英語顯示。顯然"normally the application locale is inherited from the OS environment of the host system",但似乎並沒有發生在Windows或OS X.xulrunner應用程序中的自動區域檢測

我已經添加了默認pref("intl.locale.matchOS", "true")只是爲了確保,但仍然沒有骰子。我也嘗試過xulrunner的所有版本。

如何 xulrunner應該檢測系統區域設置,我該如何做到這一點?

回答

-1

請參閱本

https://developer.mozilla.org/en-US/docs/Make_your_xulrunner_app_match_the_system_locale

from xpcom import components 
ps_cls = components.classes["@mozilla.org/preferences-service;1"] 
ps = ps_cls.getService(components.interfaces.nsIPrefService) 
branch = ps.getBranch("general.useragent.") 
branch.setCharPref("locale", lang) 

os.environ["LANGUAGE"] = lang 

朗集按區域設置。

+0

該文檔(當然,我已閱讀)是沒有用的,因爲它假定我使用Python,我不是。 (XUL的大多數用戶也不是。) – 2013-07-03 01:06:41

相關問題