Open Bug 1452449 Opened 6 years ago Updated 5 hours ago

Port Bug 1431260 "Migrate LocaleService::AvailableLocales from ChromeRegistry to multilocale.json" to SeaMonkey


(SeaMonkey :: General, enhancement, P3)



(Not tracked)


(Reporter: frg, Unassigned)


(Blocks 1 open bug)



(1 obsolete file)

+++ This bug was initially created as a clone of Bug #1431260 +++

Currently, we use Chrome Registry's `global` locale package to identify available locales [0].

As we move away from Chrome Registry we also want to move away from using it as a reference location for available locales data.

The new source of truth is L10nRegistry and its data is a combination of multilocale.json registered locales (package)[1] and language packs[2].

One of the benefits of this move is that we can vastly reduce the number of language negotiation states we go through during the bootstrap.

At the moment we hit at least 5:
1) no locales available, defaultLocale requested
2) PreferencesService reads default prefs.js, new requested locales
3) ChromeRegistry registers packages, new available locales
4) prefs.js reads user's profile prefs.js, new requested locales
5) Extensions are registered, new available locales

But in reality the number of states is much higher, since *each* time we read a new locale, ChromeRegistry registers it, triggers `available-locales-changed` and language negotiation.

I'd like to vastly simplify it. The PreferencesService rewrite should handle the (2)+(4) state, and I believe that multilocale.json can handle the (1)+(3) state, leaving us with:

1) LocaleService reads multilocale.json - available locales ready
2) PreferencesService reads default prefs.js, requested locales ready
3) Extensions are registered, new available locales

See Bug 1440235
Attachment #9387192 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.