Closed Bug 1102604 Opened 10 years ago Closed 10 years ago

SysInfo.getLocale() is wrong

Categories

(Firefox for Android Graveyard :: Locale switching and selection, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 37

People

(Reporter: rnewman, Assigned: rnewman)

Details

Attachments

(1 file)

/**
     * @return the default system locale, such as "en-US"
     */
    public static String getLocale() {
        return java.util.Locale.getDefault().toString().replace('_', '-');
    }

This will be wrong for a small set of locales (e.g., Indonesian), and in any case is O_O.

Callers should use BrowserLocaleManager.getLocaleTag(Locale) instead.
This should do the trick. Not yet tested, though.
Attachment #8540529 - Flags: review?(michael.l.comella)
Comment on attachment 8540529 [details] [diff] [review]
SysInfo.getLocale() is wrong. v1

Review of attachment 8540529 [details] [diff] [review]:
-----------------------------------------------------------------

As discussed on IRC, the Sysinfo.getLocale method should actually be removed. lgtm w/ that change.
Attachment #8540529 - Flags: review?(michael.l.comella) → review+
https://hg.mozilla.org/mozilla-central/rev/9b7ace653773
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: