Last Comment Bug 848297 - getSelectedLocale in chrome registry should allow overwritten provider
: getSelectedLocale in chrome registry should allow overwritten provider
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Localization (show other bugs)
: 22 Branch
: All All
-- normal (vote)
: mozilla23
Assigned To: Axel Hecht [:Pike]
:
: Axel Hecht [:Pike]
Mentors:
Depends on:
Blocks: 869385 869387 792077 915721
  Show dependency treegraph
 
Reported: 2013-03-06 04:19 PST by Axel Hecht [:Pike]
Modified: 2016-01-09 11:46 PST (History)
3 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
add a prefbranch to override getSelectedLocale (6.59 KB, patch)
2013-03-18 16:19 PDT, Axel Hecht [:Pike]
benjamin: review-
Details | Diff | Splinter Review
now with easier pref logic (6.07 KB, patch)
2013-04-02 07:58 PDT, Axel Hecht [:Pike]
benjamin: review+
Details | Diff | Splinter Review

Description User image Axel Hecht [:Pike] 2013-03-06 04:19:34 PST
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.
Comment 1 User image Axel Hecht [:Pike] 2013-03-06 07:15:41 PST
Let's see what try thinks, https://tbpl.mozilla.org/?tree=Try&rev=cd9a6eb14d45
Comment 2 User image Axel Hecht [:Pike] 2013-03-18 16:19:37 PDT
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 3 User image Benjamin Smedberg 2013-03-21 08:40:51 PDT
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.
Comment 4 User image Axel Hecht [:Pike] 2013-04-02 07:58:03 PDT
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 5 User image Benjamin Smedberg 2013-04-08 08:38:09 PDT
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.
Comment 6 User image Axel Hecht [:Pike] 2013-04-26 13:19:11 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/21cd4d9e679b, and I'll file a follow-up next.
Comment 7 User image Ryan VanderMeulen [:RyanVM] 2013-04-26 18:40:25 PDT
https://hg.mozilla.org/mozilla-central/rev/21cd4d9e679b
Comment 8 User image Jeff Beatty [:gueroJeff] 2013-04-27 09:24:17 PDT
(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?
Comment 9 User image Axel Hecht [:Pike] 2013-05-07 03:55:53 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.