Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Localization on Windows

2 views
Skip to first unread message

Sandip Ghosh

unread,
Feb 28, 2007, 5:10:49 PM2/28/07
to dev-te...@lists.mozilla.org
We have a cross platform localized XUL application. All UI strings are
defined as entities in XUL and properties in JS and the manifest points to
the locale folder where the DTD and property files are located. Then in
/defaults/preferences/prefs.js I have declared the preference item:
pref("general.useragent.locale", "ja-JP"); for e.g. to select the Japanese
locale.

This works perfectly on linux, but not on windows. Is there something else
that is needed to make localization for a XUL app work on windows ?

I followed the following comments in the xulplanet.com page on localization
and tried with the "Unired" text editor and selected UTF-8 character set.
That made no difference.

Yes,DTD file must be UTF-8 encoding. But UTF-8 not only ONE UTF-8! it also
have UTF8(BOM).So i suggest a great tool to select right encoding under
Windows: UniRed, You must use File->Properties->Charset[UTF-8] and Unicode
representation[&#DDDD;] to selected!! ]

Thanks for suggestions!

-Sandip

Axel Hecht

unread,
Mar 1, 2007, 4:30:29 AM3/1/07
to
Sandip Ghosh wrote:
> We have a cross platform localized XUL application. All UI strings are
> defined as entities in XUL and properties in JS and the manifest points to
> the locale folder where the DTD and property files are located. Then in
> /defaults/preferences/prefs.js I have declared the preference item:
> pref("general.useragent.locale", "ja-JP"); for e.g. to select the Japanese
> locale.
>
>
>
> This works perfectly on linux, but not on windows. Is there something else
> that is needed to make localization for a XUL app work on windows ?

No. I would expect some installation problem.

> I followed the following comments in the xulplanet.com page on localization
> and tried with the "Unired" text editor and selected UTF-8 character set.
> That made no difference.
>
>
>
> Yes,DTD file must be UTF-8 encoding. But UTF-8 not only ONE UTF-8! it also
> have UTF8(BOM).So i suggest a great tool to select right encoding under
> Windows: UniRed, You must use File->Properties->Charset[UTF-8] and Unicode
> representation[&#DDDD;] to selected!! ]

I never understood the rationale for having a byte order mark in a
single byte encoding.

Axel

Sandip Ghosh

unread,
Mar 1, 2007, 5:23:16 PM3/1/07
to Axel Hecht, dev-te...@lists.mozilla.org
Thanks for your response, yes it works for me on Windows now.
It turns I had to install the Asian language Pack for the O.S. I also
selected Japanese as the language for the "Regional Options" and "Advanced"
tabs of the windows "Regional and Language Options" dialog.

Not sure if all of this is required, but until I had the language pack
installed and these options set, XULRunner was not respecting the
general.useragent.locale setting to anything other than "en-US".

-Sandip

Axel
_______________________________________________
dev-tech-xul mailing list
dev-te...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xul

Sandip Ghosh

unread,
Mar 1, 2007, 6:54:40 PM3/1/07
to dev-te...@lists.mozilla.org, dev-tec...@lists.mozilla.org
I still have problems with setting the general.useragent.locale on windows.
There are no problems with displaying content from the selected locale, the
problems I am running into are with how the general.useragent.locale
preference item is set.

We are using the binary distribution of XUL Runner 1.8.0.4 as the runtime.
Doing a search through the JS files in the XUL Runner package, there are 2
files that are declaring this preference:
Xulrunner/greprefs/all.js:
pref("general.useragent.locale",
"chrome://navigator/locale/navigator.properties");

and xulrunner/defaults/prefs/xulrunner.js
(with some interesting comments preceeding the declaration, included here)
// We need to override the default values of these preferences since all.js
// assumes these are in the navigator package, which for us is non-existant.
// XXX(darin): perhaps all.js should not be seamonkey specific
pref("general.useragent.locale", "en-US");

I also set general.useragent.locale in the app specific prefs.js file
(/my-app/defaults/preferences/prefs.js)

I expected atleast one of the following to work (in order):

1. Any preference in the app specific prefs.js should override preferences
set anywhere else.
2. If I comment out the general.useragent.locale setting in the above 2
XulRunner location then it should pick the value set for this preference in
the app specific prefs.js

Neither of this two happen, the general.useragent.locale preference is
ALWAYS read from all.js followed by xulrunner.js and the value set in the
app specific prefs.js is ALWAYS ignored.

The work around for me to get localization to respect the selected locale is
to change the preference in xulrunner.js.

Is this a bug or am I doing something wrong here?

0 new messages