Closed
Bug 1222207
Opened 10 years ago
Closed 10 years ago
Titlebar items like Music, Playlists, Albums, Artists and Songs not localized/always in English
Categories
(Firefox OS Graveyard :: Gaia::Music, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: aryx, Assigned: justindarc)
Details
Attachments
(1 file)
B2G 2.6 20151104150239 on Flame (v18D_nightly_v4 base image)
After opening the music app, tapping on the icons at the bottom switches between the Music, Playlists, Albums, Artists and Songs views. These initially don't use the localization but are in English. I managed to get it to use the localization (German) once, but don't know how.
| Assignee | ||
Comment 1•10 years ago
|
||
This was working. Not sure what happened. Taking to investigate.
Assignee: nobody → jdarcangelo
Status: NEW → ASSIGNED
Comment 2•10 years ago
|
||
Needinfoing myself to investigate first thing after the weekend.
Flags: needinfo?(stas)
Comment 3•10 years ago
|
||
It seems like this was broken by bug 1210720 even though I'm pretty sure I didn't see it back when I tested and landed it.
Bug 1225497 seems to be related. I'll keep digging. We may want to temporarily back out bug 1210720 to fix this if I don't find a better solution soon.
Flags: needinfo?(stas)
Comment 4•10 years ago
|
||
OK, I think I know what's going on.
The header text is set by music-view-stack when a new view is loaded. However, the code doesn't wait for the new view to be translated first, so we end up with the English title.
There are two solutions:
a) make music-view-stack wait for view.frame.contentDocument.l10n.ready (which is a promise) and continue to use the assignment to headerTitle.textContent in https://github.com/mozilla-b2g/gaia/blob/master/apps/music/js/app.js#L256, or
b) make music-view-stack take the data-l10n-id of the view's title instead of the text value, pass it over to js/app.js and only then set the data-l10n-id attribute of the gaia-header's h1 element. This, however, would require that all translations of view titles be available in the index.properties file.
Comment 5•10 years ago
|
||
Comment 6•10 years ago
|
||
Comment on attachment 8689499 [details] [review]
[gaia] stasm:1222207-music-localize-headers > mozilla-b2g:master
Here's a pull request which fixes this using the first approach from my previous comment.
I ran into another problem, however: waiting for l10n.ready delays the 'loaded' event which is used to trigger the visuallyLoaded and contentInteractive perf marks. Now, 'rendered' fires earlier causing fullyLoaded to be registered before visuallyLoaded which doesn't make much sense for raptor.
Justin, Zibi: any suggestions on how to solve this?
Attachment #8689499 -
Flags: feedback?(jdarcangelo)
Attachment #8689499 -
Flags: feedback?(gandalf)
Comment 7•10 years ago
|
||
Comment on attachment 8689499 [details] [review]
[gaia] stasm:1222207-music-localize-headers > mozilla-b2g:master
Justin -- I think I'll need your help and your judgment here.
Music's views emit two evens when they're created: 'loaded', when the iframe finishes loading, and 'rendered', when the content is populated.
Currently, 'loaded' corresponds to visuallyLoaded and contentInteractive, and 'rendered' corresponds to fullyLoaded.
In this pull request I needed to delay 'loaded' a little bit so that we can use the translated value for the view's title. I did that by waiting for the document.l10n.ready promise to resolve. To be consistent, I also made 'rendered' wait for document.l10n.ready, just to be sure there's no race condition (there's no overhead to this additional waiting).
However, I noticed that the 'rendered' event was being fired too early: before we get localized content and before we load the songs and their album art. In the pull request, I moved the 'rendered' dispatch to where I think it belongs, i.e. after the gallery is loaded. This causes the perf measurements to be completely different, and I think that we should accept the fact that the measurements have been so far underrepresented.
According to my tests we're talking 300-400 ms of difference.
music.gaiamobile.org base: mean 1: mean 1: delta 1: p-value
--------------------- ---------- ------- -------- ----------
navigationLoaded 335 335 -0 0.99
navigationInteractive 347 346 -1 0.88
visuallyLoaded 548 888 340 * 0.00
contentInteractive 548 888 340 * 0.00
fullyLoaded 660 1050 391 * 0.00
uss 18.390 18.339 -0.051 0.54
rss 38.219 38.200 -0.019 0.83
pss 22.846 22.807 -0.040 0.64
Perhaps I misunderstand how the perf marks are used in Music in which case please correct me. Justin, what do you think about this? Zibi, your thoughts?
Attachment #8689499 -
Flags: feedback?(jdarcangelo) → review?(jdarcangelo)
| Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8689499 [details] [review]
[gaia] stasm:1222207-music-localize-headers > mozilla-b2g:master
This makes sense to me. If we need to delay 'loaded' slightly by waiting for a localized title to be available, then that's what we gotta do. Please address my one comment in the PR though before landing. I'd rather see us have an `onRenderDone()` method in the base `View` class instead of calling `super()` in an async manner.
Attachment #8689499 -
Flags: review?(jdarcangelo) → review+
Updated•10 years ago
|
Attachment #8689499 -
Flags: feedback?(gandalf) → feedback+
Comment 9•10 years ago
|
||
Landed in master: https://github.com/mozilla-b2g/gaia/commit/905eac9e4ea80a29aa5a3b84da6048552b04914a
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•