Translate locale codes between Java and Gecko

RESOLVED WORKSFORME

Status

()

Firefox for Android
Locale switching and selection
RESOLVED WORKSFORME
4 years ago
11 months ago

People

(Reporter: rnewman, Assigned: rnewman)

Tracking

(Depends on: 1 bug)

unspecified
All
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(fennec-)

Details

(Assignee)

Description

4 years ago
Indonesian and Hebrew (and others?) are represented as different codes in our two systems. As a follow-on from Bug 936756, we need to make sure that these are translated correctly when set.
(Assignee)

Updated

4 years ago
Blocks: 521995
(Assignee)

Comment 1

4 years ago
I see Indonesian on our roadmap for 30. Flagging for tracking; this needs to be done before that can be adequately tested.
tracking-fennec: --- → ?
Java translates the locale codes for Indonesian, Hebrew, and Yiddish from the ISO 639-1 two character codes into their depricated counterparts automatically. See "Class Overview" here: http://developer.android.com/reference/java/util/Locale.html

I'd like to verify that this is true, but without adding the locale code to maemo-locales and switching the locale within Android, I'm unsure how to proceed.

Also, the roadmap is being revisited. Indonesian may be bumped up to 28 due to the emphasis being placed on the region.
(Assignee)

Comment 3

4 years ago
(In reply to Jeff Beatty [:gueroJeff] from comment #2)

> I'd like to verify that this is true, but without adding the locale code to
> maemo-locales and switching the locale within Android, I'm unsure how to
> proceed.

Probably by doing that :D

It doesn't matter what the content is -- we just want to verify that the right files get picked for whichever code we use to identify the locale. We can start by copying an existing locale in-place and testing that way (which at least gives me a fighting chance to read the menus!).

There are two code paths to check. We want Indonesian to work correctly regardless of whether you set a locale in Android settings or inside Fennec, which means we definitely need to take the Java-native deprecated values as input and translate them for Gecko. We also need to test that whatever code we use internally gets translated in all the paths we send it through into Android (not just the Java Locale class).



> Also, the roadmap is being revisited. Indonesian may be bumped up to 28 due
> to the emphasis being placed on the region.

Ooh, exciting. How likely is that "may"?
(Assignee)

Updated

4 years ago
Depends on: 955805
(Assignee)

Comment 4

4 years ago
The patch in Bug 955805 makes this work with the locale switcher. I haven't tested the behavior when you pick the locale in Android settings; presumably it works as well as it always has.
tracking-fennec: ? → 28+
Brad thinks we might already have some code for this. Maybe a regression?
Assignee: nobody → rnewman
(Assignee)

Comment 6

4 years ago
We never shipped any locales that needed it, so I doubt this has ever been tested, so I doubt it's a regression.

The old (commented-out) scheme had Gecko manage locales, and then hand them off to Android. Java's Locale class already handles both sets of locale codes. We're now going in the other direction, and Gecko is very brittle (e.g., Bug 955805).

After Bug 955805 landed, there *should* be no work left in this bug, unless Gecko mishandles the Java environment when the locale-setting code isn't involved. (Which it might: again, we've never tested this, because those locales aren't involved.)

When we've determined that everything's working well, I'll close this.
Status: NEW → ASSIGNED

Comment 7

4 years ago
I think we still need bug 700289
(Assignee)

Comment 8

4 years ago
Making this a meta bug, then!
Depends on: 700289
Keywords: meta
Blocks: 960060
(Assignee)

Updated

4 years ago
No longer blocks: 521995
We don't track metas.
tracking-fennec: 28+ → -
(Assignee)

Comment 10

3 years ago
Jeff, Axel: is this still an issue, or can we close this as WORKSFORME?
Component: General → Locale switching and selection
Flags: needinfo?(jbeatty)

Comment 11

3 years ago
Did we get bug 700289 comment 6 right yet? That seems to be the only open issue, and I don't see a related fix in nsLocaleService.
Flags: needinfo?(jbeatty)
(Assignee)

Comment 12

3 years ago
(In reply to Axel Hecht [:Pike] from comment #11)
> Did we get bug 700289 comment 6 right yet? That seems to be the only open
> issue, and I don't see a related fix in nsLocaleService.

Switching locales to Bahasa Indonesia seems to work fine, which means the Java -> Gecko bit is working, so I'm going to close this in favor of that bug.
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Keywords: meta
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.