Closed
Bug 1018708
Opened 10 years ago
Closed 10 years ago
[Vertical] Homescreen should translate Collections names when changing locale
Categories
(Firefox OS Graveyard :: Gaia::Homescreen, defect)
Tracking
(feature-b2g:2.0, b2g-v2.0 fixed, b2g-v2.1 fixed)
People
(Reporter: amirn, Assigned: jlal)
References
Details
(Keywords: late-l10n, Whiteboard: [systemsfe])
Attachments
(1 file, 1 obsolete file)
(deleted),
text/x-github-pull-request
|
kgrandon
:
review+
bajaj
:
approval-gaia-v2.0+
|
Details |
in homescreen1 we used properties files:
https://github.com/EverythingMe/gaia/blob/master/apps/homescreen/locales/collections.en-US.properties
Reporter | ||
Updated•10 years ago
|
Blocks: collection-app
Reporter | ||
Comment 1•10 years ago
|
||
Cristian, maybe you can take this as you did excellent work with homescreen1 :)
Flags: needinfo?(crdlc)
Comment 2•10 years ago
|
||
Sorry but I have a lot of work with the migration right now mate
Flags: needinfo?(crdlc)
Reporter | ||
Comment 3•10 years ago
|
||
looping :chofmann as :cserran suggested - your feedback on using .properties files? (see description)
Flags: needinfo?(chofmann)
Comment 4•10 years ago
|
||
Hi Amir, I'm not exactly sure what the question is.
In general using .properties files is fine, but I'd need a bit more contest. Are collections for vertical homescreen different from the ones we're currently using?
Flags: needinfo?(chofmann)
Reporter | ||
Comment 5•10 years ago
|
||
(In reply to Francesco Lodolo [:flod] from comment #4)
> Are collections for vertical homescreen different from the ones we're
> currently using?
In the vertical homescreen collections are sync over the Datastore by the Collections app.
There will be a build process which will create the initial, pre-installed Collections (bug 1016225).
When a user later changes the locale, the names of the pre-installed collections should update.
The question is - how should we provide these translations?
In the old homescreen we used the .properties files I linked to. We can do the same for the Vertical homescreen unless there a better solution.
Comment 6•10 years ago
|
||
(In reply to Amir Nissim (Everything.me) from comment #5)
> In the old homescreen we used the .properties files I linked to. We can do
> the same for the Vertical homescreen unless there a better solution.
I don't think we have alternative solutions. .properties files are automatically extracted and exposed to localization tools and localizers, so that's definitely the way to go to have those names localized.
Comment 7•10 years ago
|
||
We definitely want to use a properties file to localize the strings.
For the locale change, I think one option that might be worth investigating is to see if we can populate a "manifest-like" thing from the collections app. On locale change, we can then have the homescreen perform the localization. So in addition saving the name and pinned results, we could also save a map of string - the same way a mozApp result works. This does create a bit of complexity when we do save the collection, and we would need to know the available locales on the device.
Another option would be to fire an IAC message and have the collections app update each object's name attribute - the datastore sync would just take care of everything.
Comment 8•10 years ago
|
||
Amir, This all seems very complicated, and I might be misunderstanding, but I think your question is about how should the localization of "collections" appear when the user changes locale. I've take a crack at recapping my understanding of the issues based on the things you said above. Feel free to correct any of this.
The complication is that there is an initial build list of collections (.properties file), then the collections list gets updated from marketplace in a synching process (that works using jason for the transfer?).
So this will mean there should be two sources of "collection lists" for each locale as well. One in the initial build, and one on market place that the collection app synch's up with.
If a locale change has been made it seems a reasonable UX response should be to go directly to the "collection list" from marketplace, rather than going to the initial build collection list, then updating to the marketplace collection list.
Does that summarize how you expect this to work?
Marketplace gets localized by pei mo and clouserw. They will have the best idea on how to get collection lists localized and stored on market place that the collection app would synch with.
Comment 9•10 years ago
|
||
Just throwing randomly uneducated thoughts into the pot:
This sounds like the contacts API problem, where each consumer of the contacts API needs to localize the field names.
That is indeed a challenge in API design, and if you're having a data-based api like datastore, then, yes, each consumer of that api will need to localize each data item from scratch.
Reporter | ||
Comment 10•10 years ago
|
||
is it possible for an inactive app to observe the device locale?
if there is a way to do that, then the collection app can run a background process when the locale changes, update the datastore and the homescreen will update by the datastore bindings.
this way we can re-use the locale files already in the collection app.
Comment 11•10 years ago
|
||
How often will collections change?
For things like:
Showbiz = Showbiz
Social = Social
Games = Games
Music = Music
It seems like not very often. I suspect locale switching happens pretty infrequently as well, but maybe telemetry could tell us something about that. Is there a UX design for this?
If all the data changes infrequently the design of this for data updates and synchronization might want to follow that idea and be as simple as possible.
Comment 12•10 years ago
|
||
From my point of view:
1) User changes the locale En -> Es
2) Homescreen (or system,...) is listening when it happens and via IAC send a message to collection app, hey app "localize" please.
3) The collection app gets locales and via .properties file changes the names for collections in the datastore
4) Automatically all homescreens running or any app listening for changes on the datastore should update labels
What do you think guys?
Thanks a lot
Reporter | ||
Comment 13•10 years ago
|
||
(In reply to Cristian Rodriguez (:crdlc) from comment #12)
sounds good.
when we have steps 1 and 2 implemented I can it from there...
Comment 14•10 years ago
|
||
I could take care of the first step but I like to know which app should do it, vertical-home or system, kevin?
Flags: needinfo?(kgrandon)
Comment 15•10 years ago
|
||
The homescreen may not be running, so we would need to store the last locale in asyncStorage or something, then check that it's still the same on startup - and if not send a message. It also seems like a lot of work if third party homescreens need to do this.
FWIW - I still like the idea of reading from shared/resources/languages.json and populating a manifest-like with all possible translations on create. It's more complex during create time, but lowers runtime complexity which I like.
Flags: needinfo?(kgrandon)
Updated•10 years ago
|
QA Whiteboard: [VH-FL-blocking-]
QA Whiteboard: [VH-FL-blocking-] → [VH-FL-blocking-][VH-FC-blocking+]
Comment 16•10 years ago
|
||
Kevin - Should we call this feature work or a bug? Just want to know which flag I need to set here.
Flags: needinfo?(kgrandon)
Comment 17•10 years ago
|
||
However you want to track it. It's part of the feature but also a bug :)
Feature work I guess because it's not a regression?
Flags: needinfo?(kgrandon)
Comment 18•10 years ago
|
||
Okay - Candice - Can you add the feature-b2g flag here?
QA Whiteboard: [VH-FL-blocking-][VH-FC-blocking+] → [VH-FL-blocking+][VH-FC-blocking+]
Flags: needinfo?(cserran)
Updated•10 years ago
|
feature-b2g: --- → 2.0
Updated•10 years ago
|
Flags: needinfo?(cserran)
Updated•10 years ago
|
Whiteboard: [systemsfe]
Target Milestone: --- → 2.0 S4 (20june)
Assignee | ||
Comment 19•10 years ago
|
||
Okay- I am going to take a shot at this....
My plan looks like this:
At build time generate .json files which contain a locale manifest (like the mozapps do) this information will be read directly from our localization files (need to make sure this works for both in tree and out of tree locales)
Example:
/manifests/$CATEGORY_ID/manifest.json
(this structure intentionally maps directly to the webapp.manifest structure)
{
"locales": {
"en-US": {
"name": "xfoo"
},
....
}
}
The collections app will read the json file and add the .locales section to results stored in the datastore.
The homescreen(s) will read the current locale and look up the correct naming based on the values set in the locales dictionary...
I am trying to avoid the need for issuing many XHR requests to the manifests and then building the manifest from the results of those... This would be fairly slow and easily done later if for some reason we need to fetch manifest names from the locale files directly.
Assignee: nobody → jlal
Assignee | ||
Comment 20•10 years ago
|
||
About this: https://bugzilla.mozilla.org/show_bug.cgi?id=1016245#c3 does the e.me server already have localized names for the collections? If so can we return them in the server request for collections?
Flags: needinfo?(amirn)
Reporter | ||
Comment 21•10 years ago
|
||
(In reply to James Lal [:lightsofapollo] from comment #20)
> About this: https://bugzilla.mozilla.org/show_bug.cgi?id=1016245#c3 does the
> e.me server already have localized names for the collections? If so can we
> return them in the server request for collections?
sure. see https://github.com/mozilla-b2g/gaia/blob/master/apps/collection/js/suggestions.js#L34-L37
Flags: needinfo?(amirn)
Assignee | ||
Comment 22•10 years ago
|
||
I am going to use a much simpler approach like we used in v1.4 but with a shared locale file rather then trying to use a (IMO better but more complicated) approach that works better for third-party homescreens using datastore.
Assignee | ||
Comment 23•10 years ago
|
||
Works well for me on the collections app and on the homescreen... this requires each new app which uses the collection datastore to also include the l10n ini file I added in shared.
Needs an integration test.
Attachment #8442668 -
Flags: review?(amirn)
Reporter | ||
Comment 24•10 years ago
|
||
Comment on attachment 8442668 [details]
https://github.com/mozilla-b2g/gaia/pull/20730
please address comments on Github.
Thanks
Assignee | ||
Comment 25•10 years ago
|
||
Comments addressed
Comment 26•10 years ago
|
||
Comment on attachment 8442668 [details]
https://github.com/mozilla-b2g/gaia/pull/20730
I took a look and it appears everyone's comments are addressed. We also have a green gaia-try build, so I think we are good here. Thanks guys!
Attachment #8442668 -
Flags: review?(amirn) → review+
Comment 27•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 28•10 years ago
|
||
Hmm, looks like we crossed paths with another merge, might just need to update unit tests... I'll take a look. https://tbpl.mozilla.org/php/getParsedLog.php?id=42094397&tree=B2g-Inbound
Reverted. https://github.com/mozilla-b2g/gaia/commit/a28cc995f42dd03a4f831a0f44f3c732a9c0b041
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 29•10 years ago
|
||
New pull request. I added a single line to the test to include l10n.js as we now need that since crossing paths with a commit that added tests.
Attachment #8442668 -
Attachment is obsolete: true
Attachment #8443143 -
Flags: review+
Comment 30•10 years ago
|
||
Conflicts from cross-merge resolved. Landed: https://github.com/mozilla-b2g/gaia/commit/ae83bfe08752493e276bd432056bedf8ac592c53
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
Comment 31•10 years ago
|
||
Comment on attachment 8443143 [details]
Github pull request
This is needed for the vertical homescreen.
Attachment #8443143 -
Flags: approval-gaia-v2.0?(bbajaj)
Updated•10 years ago
|
Attachment #8443143 -
Flags: approval-gaia-v2.0?(bbajaj) → approval-gaia-v2.0+
Comment 32•10 years ago
|
||
status-b2g-v2.0:
--- → fixed
status-b2g-v2.1:
--- → fixed
Can you verify this bug?
Flags: needinfo?(tchevalier)
Comment 34•10 years ago
|
||
Long press on Home -> Add Smart collections, the list is displayed localized in Italian on my Keon (2.1, git commit 2014-06-20 734d8459). If I switch to English, I get the English descriptions.
If I select one, I don't see it appearing on the home (maybe a different bug).
Comment 35•10 years ago
|
||
Hey Francesco - anything in logcat when you see that? Thanks!
(A lot of pieces for smart collections are landing today, so it may be a bit premature to verify bugs against it)
Comment 36•10 years ago
|
||
Used Flod's Italian translations, I also got the list correctly localized.
If I select one, it's correctly added to the Homescreen.
Its name is correctly localized on the Homescreen as well.
However, the name on the header once opened is wrong:
Installed collection-categoryId-296 = Intorno a me
I got "Intorno a me" on the homescreen, but "Vicino a Me" on the header.
Opening a follow-up bug for that.
Tried on Flame with
Gaia 008b5a4d1be8cb8416543047a748681cc70ea193
Gecko https://hg.mozilla.org/releases/mozilla-aurora/rev/46b6814727ba
BuildID 20140619160205
Version 32.0a2
ro.build.version.incremental=eng.theo.20140613.174651
ro.build.date=vendredi 13 juin 2014, 17:47:02 (UTC-0700)
Status: RESOLVED → VERIFIED
Flags: needinfo?(tchevalier)
Comment 37•10 years ago
|
||
(In reply to Kevin Grandon :kgrandon from comment #35)
> Hey Francesco - anything in logcat when you see that? Thanks!
Something must have fixed it in the middle: flashed keon with the current tip of master, and it works.
I can confirm the behavior described by Théo: icon's name is localized, but when I open it I get e.me's name, which is different.
Comment 38•10 years ago
|
||
Right - we may want to talk to the E.me guys about this. They actually wanted the server to be able to override local translations in certain cases - but it does make sense that the label should match up to the header.
Flags: in-moztrap?(tchevalier)
Flags: in-moztrap?(theo)
You need to log in
before you can comment on or make changes to this bug.
Description
•