We want sparse localizations of toolkit for both Android and Firefox OS multilocale builds. The easiest way to do that is to overload the files that are actually used with a different package, but then getSelectedLocale() is wrong. So is GetLocalesForPackage(). Let's allow to tell the chrome registry which provider to ask a different package by adding a pref branch.
Let's see what try thinks, https://tbpl.mozilla.org/?tree=Try&rev=cd9a6eb14d45
Created attachment 726393 [details] [diff] [review] add a prefbranch to override getSelectedLocale I didn't get feedback from the Android folks yet, but I expect we'll end up needing this for b2g RSN, so requesting review.
Comment on attachment 726393 [details] [diff] [review] add a prefbranch to override getSelectedLocale I don't want to hold the long-lived branch object, and we don't need the special safe-mode behavior. Please just have nsChromeRegistryChrome::OverrideLocalePackage use mozilla::Preferences directly and skip the branch goop.
Created attachment 732328 [details] [diff] [review] now with easier pref logic Addressing the review comments, using the mozilla::Preferences api, don't store a pref branch.
Comment on attachment 732328 [details] [diff] [review] now with easier pref logic This really sucks and if there isn't a bug filed on removing this hack, please file one. But it's ok for now.
https://hg.mozilla.org/integration/mozilla-inbound/rev/21cd4d9e679b, and I'll file a follow-up next.
(In reply to Axel Hecht [:Pike] from comment #6) > https://hg.mozilla.org/integration/mozilla-inbound/rev/21cd4d9e679b, and > I'll file a follow-up next. What is the follow up bug number?
I've filed two follow-ups, bug 869385 to not use prefs if we have a better storage for this data, and bug 869387 to rip out this code path completely once we support sparse localizations/l10n fallback at runtime.