Open Bug 1346877 Opened 7 years ago Updated 2 years ago

Finalize LocaleService

Categories

(Core :: Internationalization, enhancement, P3)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

(Depends on 3 open bugs)

Details

There's a shrinking number of changes that we need to add to LocaleService before it can be considered stable.

I'd like to use this tracking bug to track those and once they're all resolved, I'd like to clean up docs and tests.
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Depends on: 1347002
Depends on: 1339650
Depends on: 1347272
Depends on: 1348042
Depends on: 1349375
Depends on: 1349377
 - look at what functions could can take const.
 - should switch to artifical locales in tests to ensure that real test env. locales don't create false positives.
:jfkthame brought up a point in bug 1346616 that we should return `undefined` for missing value in singular calls like getRequestedLocale, getAppLocaleAsLangTag, getAppLocaleAsBCP47.

While my hope is that we'll move away from the singular forms overall, it would be good to make sure that we don't treat the edge case scenarios (when request locale is not set) the same way as if it's set to an empty string.

I'll try to do this in this bug, add tests and also test extensively if any use case of the API breaks.
(also, probably the same should happen with OSIPreferences.systemLocale).
As :qDot pointed out in bug 1348042 comment 20, we may want to look into splitting LocaleService into Client/Server files and classes that inherit from a base class.

I'd prefer to do that as part of this bug so that it's not combined with functional changes.
Depends on: 1358628
Depends on: 1358653
While you're splitting out functionality in LocaleService, could you also throw main thread checks in on GetInstance and all public service functions? There's a ton of code in there that will crash anyways if anything happens off the main thread (preferences, clearonshutdown, etc), but it's just nice to fail early if we can.
Jonathan, what's your take on splitting LocaleService into LocaleServiceBase, LocaleServiceClient and LocaleServiceParent?
Flags: needinfo?(jfkthame)
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #7)
> Jonathan, what's your take on splitting LocaleService into
> LocaleServiceBase, LocaleServiceClient and LocaleServiceParent?

I don't feel strongly about it, but I do think it'd probably be good for long-term readability and maintenance.
Flags: needinfo?(jfkthame)
Summary: Finalize LanguageService → Finalize LocaleService
Depends on: 1352343
Depends on: 1410736
Depends on: 1414390
Depends on: 1414878
Priority: -- → P3
Depends on: 1418771
Depends on: 1424953
Depends on: 1438687
Depends on: 1440969
Depends on: 1448891
Depends on: 1491209
Depends on: 1491394
Depends on: 1633675

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: zibi → nobody
Status: ASSIGNED → NEW

Sorry, there was a problem with the detection of inactive users. I'm reverting the change.

Assignee: nobody → zibi
Status: NEW → ASSIGNED
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.