Closed Bug 533814 Opened 16 years ago Closed 16 years ago

Make posix locale claim to be nb-NO if it hits no_NO

Categories

(Core :: Internationalization, defect)

1.9.2 Branch
x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Tracking Status
status1.9.2 --- final-fixed

People

(Reporter: Pike, Assigned: smontagu)

Details

Attachments

(1 file, 3 obsolete files)

The maemo device is sending the deprecated no_NO locale code for Norwegian, and we should map that to the best match we have, which is nb-NO.
In what context exactly? Do you mean that GetSystemLocale should return nb-NO when the locale it gets from the OS is no-NO?
AFAICT, it boils down to GetXPLocale, http://mxr.mozilla.org/mozilla/source/intl/locale/src/unix/nsPosixLocale.cpp#100. It starts in the chrome registry, http://mxr.mozilla.org/mozilla-central/source/chrome/src/nsChromeRegistry.cpp#444. But yes, if we see no-NO (actually, no_NO), report that as nb-NO instead of no-NO.
Attached patch Patch (obsolete) — Splinter Review
Not asking review yet because I have no way to test it this week, but attaching in case someone else wants to test.
Comment on attachment 417022 [details] [diff] [review] Patch AFAICT, this should happen on lang_code instead of country_code.
Attached patch Patch v.2 (obsolete) — Splinter Review
Thanks, Axel! (the previous version wouldn't even have compiled because I left out the "_" in country_code)
Attachment #417022 - Attachment is obsolete: true
Attached patch Patch v.3 (obsolete) — Splinter Review
Third time's the charm...
Attachment #417033 - Attachment is obsolete: true
Comment on attachment 417034 [details] [diff] [review] Patch v.3 Looks good to me, any chance to test this yet?
I've run into a catch-22 testing this: the only system that I have that uses posix locale is Ubuntu, where I can install nb_NO or nn_NO but no no_NO.
Simon: I can test on n900 and n810 if you have a test build that I can run.
Comment on attachment 417034 [details] [diff] [review] Patch v.3 stricmp doesn't compile on arm, trying with strcasecmp now. Not sure if that is more portable.
With strcasecmp, I got a working build that detects norks OK. Do we have something in nspr or so to abstract the platform-dependent extensions?
This should be portable enough
Attachment #417034 - Attachment is obsolete: true
Attachment #418717 - Flags: review?
Attachment #418717 - Flags: review? → review?(l10n)
Comment on attachment 418717 [details] [diff] [review] Use nsDependentCString.LowerCaseEqualsLiteral Looks good to me. Can you run this through the try server?
Attachment #418717 - Flags: review?(l10n) → review+
I downloaded the build from comment 15, but it was a single-locale build (en-US). I tried to build myself yesterday and was able to get a working build with the patch from attachment 418717 [details] [diff] [review]: <http://l10n.mozilla.org/~stas/builds/fennec-1.0b6pre-20091221.multi.linux-gnueabi-arm.tar> (You may still need the xulrunner package from the url in comment 15.) I ran make chrome-ab-CD for every locale in maemo-locales before running make package. With matchOS set to true, it correctly detected nb-NO when the OS was set to no-NO. Looks like it's working :)
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Attachment #418717 - Flags: approval1.9.2.1?
Comment on attachment 418717 [details] [diff] [review] Use nsDependentCString.LowerCaseEqualsLiteral a192=beltzner
Attachment #418717 - Flags: approval1.9.2.1? → approval1.9.2+
Verified on Mozilla/5.0 (X11; U; Linux armv7l; en-US; rv:1.9.2b6pre) Gecko/20091223 Firefox/3.6b6pre Fennec/1.0b6pre running on N900 on Maemo 5 (1.2009.42-11.002) in Nowegian ("Norsk (Norge)") $ locale LANG=no_NO LC_CTYPE="no_NO" LC_NUMERIC=no_NO LC_TIME=no_NO LC_COLLATE="no_NO" LC_MONETARY=no_NO LC_MESSAGES=no_NO LC_PAPER=no_NO LC_NAME=no_NO LC_ADDRESS=no_NO LC_TELEPHONE=no_NO LC_MEASUREMENT=no_NO LC_IDENTIFICATION=no_NO LC_ALL= $
Status: RESOLVED → VERIFIED
Flags: in-litmus?
Flags: in-litmus?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: