Closed Bug 610151 Opened 14 years ago Closed 14 years ago

Firefox 4b2 (Android) Locale auto-detection does not work

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(fennec2.0b3+)

VERIFIED FIXED
Tracking Status
fennec 2.0b3+ ---

People

(Reporter: Nukeador, Assigned: alexp)

References

Details

Attachments

(1 file)

Using Android 2.2 and es_ES locale, Firefox auto-detects English as my locale.

Maybe the reason is Mozilla uses es-ES and Android uses es_ES.

Tell me if you require more information about my system.
tracking-fennec: --- → ?
Assignee: nobody → alexp
tracking-fennec: ? → 2.0b3+
Axel, any ideas here?
Not really. The code in question is nsLocaleService::GetSystemLocale, I don't have a better idea than stepping through the code in a debugger on an android build.
Not sure if he can help, but I added Aki to this bug.
The dash-versus-underscore seems like a very likely culprit.
If, say, de or fi work, that would probably be it; if not, it's something else.

bug 596004 comment 2 seems to say, to me at least, that we need an android-locale-to-fennec-locale mapping.
Android should use posix locale code in nsLocaleService::nsLocaleService, setting mSystemLocale.

That code should handle underscores just fine, it works on linux etc.

My suspection is more along the lines that that code doesn't get the right info on the system locale info, like, not the right env vars or somesuch.
(In reply to comment #5)
> My suspection is more along the lines that that code doesn't get the right info
> on the system locale info, like, not the right env vars or somesuch.

Yes, this is the case.
Both calls getenv("LANG") and setlocale(category) return NULL.
I'll check what we could use on Android.
Attached patch FixSplinter Review
Add LANG environment variable with the language from the system.
Attachment #490932 - Flags: review?(blassey.bugs)
Attachment #490932 - Flags: review?(blassey.bugs) → review+
Keywords: checkin-needed
CCing smontagu. Not sure if he knows a lot about Android, but he should know what we do to make this work.
FWIW I did test this patch before landing and it seemed to select between es/en/ja fine.

http://hg.mozilla.org/mozilla-central/rev/e4be53fa74aa
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Blocks: 616377
Verified on Mozilla/5.0 (Android;Linux armv7l;rv:9.0a1)Gecko/20110911 Firefox/9.0a1 Fennec/9.0a1
Device: HTC Desire
OS: Android 2.2
Fennec auto-detects correctly the system language.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: