Closed Bug 1043615 Opened 5 years ago Closed 5 years ago
[L10n][Settings] Clean up moz
L10n .get uses in Settings app
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.
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
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
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!
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.
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.
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
Follow up patch to update L10n ID's - https://github.com/mozilla-b2g/gaia/commit/9689218473b6fc4dd927ad6aa7b06c05f0843824
You need to log in before you can comment on or make changes to this bug.