Closed Bug 830521 Opened 13 years ago Closed 13 years ago

with precompiled l10n we fire "localized" event twice

Categories

(Firefox OS Graveyard :: Gaia, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:-, b2g18 fixed)

RESOLVED FIXED
blocking-b2g -
Tracking Status
b2g18 --- fixed

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Attachment #702000 - Flags: review?(kaze)
ok. this bug is not as innocent as I thought. Because we rarely remove the listener, we actually fire all the code that depends on the event in all apps twice, which contributes to startup timing.
blocking-b2g: --- → tef?
A good workaround to this is to unregister the localized handler when starting your app (which you should really do anyway since the event will fire again later if the user changes locales...)
:kaze, what do you think about that ?
Flags: needinfo?(kaze)
Like I wrote on m.d.gaia when djf reported this bug a few days ago, I sure agree it should be fixed. This patch works but it relies on the fact that `loadLocale' is called twice — which is what should be fixed, precisely. Give me a couple hours, I’ll r+ Gandalf’s patch if I can’t find any better fix.
Flags: needinfo?(kaze)
(In reply to Fabien Cazenave [:kaze] from comment #5) > This patch works but it relies on the fact that > `loadLocale' is called twice um. no. loadLocale is called once. It just calls fireL10nReadyEvent twice without this patch.
blocking-b2g: tef? → -
Looking at the code I would say the right fix will be to omit the second argument of loadLocale at line 942. The early return in the patch will not set the state of l10n as 'complete'.
(In reply to Vivien Nicolas (:vingtetun) from comment #7) > Looking at the code I would say the right fix will be to omit the second > argument of loadLocale at line 942. The early return in the patch will not > set the state of l10n as 'complete'. Good point. Updated the pull request
Comment on attachment 702000 [details] Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/7602 I much prefer this approach. Gandalf, Vivien, thanks for your help! [Approval Request Comment] Bug caused by (feature/regressing bug #): User impact if declined: Testing completed: Risk to taking this patch (and alternatives if risky):
Attachment #702000 - Flags: review?(kaze)
Attachment #702000 - Flags: review+
Attachment #702000 - Flags: approval-gaia-master?(21)
Attachment #702000 - Flags: approval-gaia-master?(21) → approval-gaia-master+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: