Closed Bug 1043615 Opened 5 years ago Closed 5 years ago

[L10n][Settings] Clean up mozL10n.get uses in Settings app

Categories

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

x86
All
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: zbraniecki, Assigned: zbraniecki, Mentored)

References

()

Details

(Whiteboard: [good first bug])

Attachments

(1 file)

Settings use mozL10n.get in 44 places and mozL10n.localize in 31 and mozL10n.translate in one.

The goal is to replace localize with setAttributes, remove the translate and minimize the amount of gets.
Whiteboard: [good first bug]
Actually, there are at least 100 more mozL10n.localize use cases. Just harder to grep. They use utils.js@localize and var l10n = navigator.mozL10n; l10n.localize
Blocks: 994519, 1020138
Blocks: 1020137
No longer blocks: 994519
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Attached file pull request
Oh, this is going to be fun.

Arthur, the pull request cleans all mozL10n.localize and mozL10n.translate uses in Settings and moves majority of mozL10n.get to DOM l10nId based approach which makes the code retranslatable.

There are no changes in logic, but a lot of files are affected.

If you prefer me to somehow chunk it to make review process easier, let me know!
Attachment #8462800 - Flags: review?(arthur.chen)
Comment on attachment 8462800 [details] [review]
pull request

Thank you for cleaning this up, Zibi! That was a lot of work.

Overall it looks good to me. There are a few minor issues to be addressed. Please check github for details.
Attachment #8462800 - Flags: review?(arthur.chen)
Comment on attachment 8462800 [details] [review]
pull request

Cool! That was easy to update. I pushed updates to the PR and triggered new try builds.
Attachment #8462800 - Flags: review?(arthur.chen)
Arthur, one test failed:

 - settings/test/unit/about_test.js | about > checkForUpdates > getting response for system update > check-error | expected 'check-error' to equal 'check-error-http-200'

What should I do with the check-error vs. check-error-* ? Update the test?
I think we could change the expected value to `check-error` instead of errors[i].
makes sense. Updated the PR
Comment on attachment 8462800 [details] [review]
pull request

r=me with one last comment addressed, thank you!
Attachment #8462800 - Flags: review?(arthur.chen) → review+
Thanks Arthur the great review!

Commit: https://github.com/mozilla-b2g/gaia/commit/eced8a617b6fde7962e1746f4e65336aaddd86c3
Merge: https://github.com/mozilla-b2g/gaia/commit/746dbbf5665c3ed8c4baad8474c011966e706ccd
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Depends on: 1048711
No longer depends on: 1048711
Depends on: 1057452
You need to log in before you can comment on or make changes to this bug.