Closed Bug 1118444 Opened 9 years ago Closed 9 years ago

Check against all navigator.languages values for possible supported locales


(Firefox OS Graveyard :: Gaia::L10n, defect)

Not set


(Not tracked)



(Reporter: standard8, Assigned: standard8)




(1 file)

Currently l10n.js' use of navigator.languages only checks the first item in the array. So, if that language is not supported, it falls back to the default locale.

For Loop, we want to be able to fallback down the languages list to find the first language code that is supported.

I've already done a patch for loop, but want to contribute it back to gaia so that we can maintain consistent versions.
This changes the code to iterate through the requested array (effectively coming from navigator.languages) to find the first supported locale.

Also extends the unit test.
Attachment #8545241 - Flags: review?(gandalf)
Comment on attachment 8545241 [details] [review]
Link to Github pull-request:

Thanks for the patch Mark!

Stas, can we do this on master?
Attachment #8545241 - Flags: review?(stas)
Blocks: 1118905
Ping: Stas/Zibi, any chance we can move this forward?
Flags: needinfo?(stas)
Hi Mark, we will look into this but not sooner than in a week time. It's on my list, but we first need to calm down the waters around 2.2 landings. Sorry for the delay!
Comment on attachment 8545241 [details] [review]
Link to Github pull-request:

Thanks, Mark.  Sorry I didn't review this earlier.  I left two comments on github.  r=me.
Flags: needinfo?(stas)
Attachment #8545241 - Flags: review?(stas)
Attachment #8545241 - Flags: review?(gandalf)
Attachment #8545241 - Flags: review+
Staś, thanks for the review, I responded to one comment and updated the patch for the other.

Can you do the merge of the pull request? I don't have access to the b2g repos (first patch on gaia!).
Flags: needinfo?(stas)

Thanks again, Mark!
Closed: 9 years ago
Flags: needinfo?(stas)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.