Closed Bug 1052136 Opened 10 years ago Closed 10 years ago

Clean up mozL10n API use in Communications

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

Details

Attachments

(5 files, 2 obsolete files)

Review use cases of: - mozL10n.translate - mozL10n.localize - mozL10n.get
Attached file pull request (obsolete) (deleted) —
Francisco, can you take a look at this? I cleaned up all mozL10n.translate uses (obsolete) and migrated mozL10n.localize to mozL10n.setAttributes. I also moved a lot of mozL10n.get to use data-l10n-id on Nodes. Some of those are trivial, others required some changes to the API (like utils.overlay and utils.status). I didn't touch a few complex cases, where I wasn't sure where the API is used and I also didn't touch any ConfirmDialogs/CustomDialogs. That will be covered by bug 1041404. I think it's enough for this bug to clean up what is in the PR.
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Attachment #8471209 - Flags: review?(francisco)
Comment on attachment 8471209 [details] pull request @gandalf, I'm so sorry, it took me so much time that now it doesnt merge, could you rebase? I'll promise I will put some love on this.
Attachment #8471209 - Flags: review?(francisco)
Comment on attachment 8471209 [details] pull request Sure! Updated the patch. I still left plenty of mozl10n.get's (like almost 200). Most of them should be clean up, but they're entangled in API's like ConfirmDialog (bug 1041404) and TAG_OPTIONS and I didn't want to touch that here.
Attachment #8471209 - Flags: review?(francisco)
ping? :)
Flags: needinfo?(francisco)
Comment on attachment 8471209 [details] pull request Hi, amazing job here, just left a couple of nits, really tiny modifications. Appart from that I found this: E/GeckoConsole( 7812): [JavaScript Error: "ReferenceError: _ is not defined" {file: "app://communications.gaiamobile.org/contacts/js/tag_options.js" line: 7}] while running, I guess we are missing the tag_options file probably relies on a global definition of '_' I think that the integration tests in js and python are failing cause of that, once fixed, sure everything comes back to green. Thanks again and sorry for the delay!
Attachment #8471209 - Flags: review?(francisco) → review-
Flags: needinfo?(francisco)
Comment on attachment 8471209 [details] pull request updated the patch, the build is green, re-requesting review
Attachment #8471209 - Flags: review- → review?(francisco)
Blocks: 1064561
Comment on attachment 8471209 [details] pull request Jose, I've been talking with :gandalf before and we decided not to merge this one during the first sprint, since we had several things to fix and could potentially cause several conflicts. But now we could land this on master without any problem. All the apps are moving to the new l10n system and contacts must do it as well, so would you pind putting some love in this patch? Thanks!
Attachment #8471209 - Flags: review?(francisco) → review?(jmcf)
Comment on attachment 8471209 [details] pull request this PR is huge and introduce many regression risk. My recommendation would be to separate this in smaller pieces in order to make it easy to review and to backout in case of regressions. My recommentation here is to separate this in: + changes that affect common componentes (overlay, status, etc.) + changes that affect views (list, settings, form, tags) So we would need several PRs to be reviewed and tested one by one and incrementally.
Attachment #8471209 - Flags: review?(jmcf) → review-
Attached file pull request, commons part (deleted) —
Makes sense Jose. I'll start with the more challenging part - commons. I'm mostly turning utils.status and utils.overlay to use l10n DOM attrs here. I'd like to get this landed first, because it will unblock gauv to work on bug 1058985 and then I'll work on the simpler pieces in communications itself.
Attachment #8471209 - Attachment is obsolete: true
Attachment #8491197 - Flags: review?(jmcf)
Comment on attachment 8491197 [details] pull request, commons part Gandalf, thanks for separating out. We also need a review from a FTU peer.
Attachment #8491197 - Flags: review?(jmcf)
Attachment #8491197 - Flags: review?(fernando.campo)
Attachment #8491197 - Flags: review+
Comment on attachment 8491197 [details] pull request, commons part FTU part looks nice, thanks gandalf.
Attachment #8491197 - Flags: review?(fernando.campo) → review+
Attached file pull request, views part (obsolete) (deleted) —
And that's the simpler part. Just views, almost exclusively switching to DOM API, and removing one LazyL10n wrapper.
Attachment #8493441 - Flags: review?(jmcf)
Comment on attachment 8493441 [details] pull request, views part the PR is still too big: Please separate in smaller parts. - Contacts common part - settings - details - form - list thanks
Attachment #8493441 - Flags: review?(jmcf) → review-
Attached file pull request, dialer part (deleted) —
Attachment #8491197 - Attachment is obsolete: true
Attachment #8494784 - Flags: review?(jmcf)
Attached file pull request, contacts commons part (deleted) —
Attachment #8494887 - Flags: review?(jmcf)
Attachment #8491197 - Attachment is obsolete: false
Attachment #8493441 - Attachment is obsolete: true
Attached file pull request, views part (deleted) —
Attachment #8495004 - Flags: review?(jmcf)
Ok, I tried to split this into three parts that I found most logically divisible: - dialer - contacts commons - contacts views Let me know if that works for you
Comment on attachment 8494784 [details] pull request, dialer part please ask a dialer peer for a review thanks
Attachment #8494784 - Flags: review?(jmcf)
Comment on attachment 8494887 [details] pull request, contacts commons part can we aim at smaller PRs? I would like to keep separated contact duplicates stuff, fb link stuff, the smaller the better please let me know if you need help in separating out things. I can help you thanks!
Attachment #8494887 - Flags: review?(jmcf) → review-
Comment on attachment 8495004 [details] pull request, views part :gandalf, I believe we need another round in this PR. Nonetheless, I'm happy to see that is small and manageable. Please check the comments on GH. thanks for the effort!
Attachment #8495004 - Flags: review?(jmcf)
Depends on: 1072797
Attachment #8494784 - Flags: review?(drs+bugzilla)
No longer depends on: 1072797
Comment on attachment 8495004 [details] pull request, views part Nits addressed and questions answered. Rerequesting r?
Attachment #8495004 - Flags: review?(jmcf)
Comment on attachment 8494887 [details] pull request, contacts commons part Chunked out the smallest batch that I believe makes sense. Let me know if this one will work for you :)
Attachment #8494887 - Flags: review- → review?(jmcf)
Comment on attachment 8494784 [details] pull request, dialer part Thanks for doing this, and for getting index.js to pass jshint. I'm getting this error after hanging up from a call (r- only for this): W/Usage ( 5423): [JavaScript Error: "too much recursion" {file: "app://costcontrol.gaiamobile.org/shared/js/l10n.js" line: 921}] This is likely coming from something in the call log. This otherwise works well and looks good. Though I'm confused about the intended scope of this. Do you want to do this incrementally? There are still plenty of LazyL10n references and mozL10n.get()'s, though the latter are admittedly not as bad. I'm fine with not hitting everything right away, but I'm not sure to what extent you want me to mention when I notice something is missing.
Attachment #8494784 - Flags: review?(drs+bugzilla) → review-
It's mainly a cleanup and update to the new API. I'm not planning to remove LazyL10n unless it is not needed as we switch to declarative API. I believe I looked through all uses of mozL10n.get and the ones that I left there mostly made sense, so I'm ok with keeping them :) I'll look into the recursion error and rerequest review once I fix that.
That's an interesting case. It seems like the recursion happens only in pseudo-locales (that's the only scenario in which we use walkContent). I suspect that this should also happen without this patch, but need to test more. Do you have any guess on what may be causing this?
Flags: needinfo?(stas)
Comment on attachment 8494784 [details] pull request, dialer part Doug, I verified that the bug exists on master and is unrelated to this patch. I reported it as bug 1073338 and am rerequesting review on this patch :)
Attachment #8494784 - Flags: review- → review?(drs+bugzilla)
Comment on attachment 8494784 [details] pull request, dialer part Ok, thanks for checking. I left one nit on the PR.
Attachment #8494784 - Flags: review?(drs+bugzilla) → review+
Comment on attachment 8495004 [details] pull request, views part thanks :gandalf for fixing and cleaning the code good work!
Attachment #8495004 - Flags: review?(jmcf) → review+
Comment on attachment 8494887 [details] pull request, contacts commons part thanks for splitting this up, easier to read and review good work!
Attachment #8494887 - Flags: review?(jmcf) → review+
Attached file pull request, utils (deleted) —
This may be the last piece of the puzzle. There are two more things that I could do: - move TAG_OPTIONS to use l10nId - move Notification API to use l10nId What do you think. Worth it?
Attachment #8496400 - Flags: review?(jmcf)
Comment on attachment 8496400 [details] pull request, utils I left substantive comments on GH. We need another round thanks
Attachment #8496400 - Flags: review?(jmcf)
Clearing needinfo on me. I'm fixing the bug from comment 26 in bug 1073338.
Flags: needinfo?(stas)
Comment on attachment 8496400 [details] pull request, utils Thanks for the feedback! I applied changes and am rerequesting r?
Attachment #8496400 - Flags: review?(jmcf)
Comment on attachment 8496400 [details] pull request, utils r=me provided the latest nits and comments are addressed properly. please check thanks for the work, Gandalf
Attachment #8496400 - Flags: review?(jmcf) → review+
Commit: https://github.com/zbraniecki/gaia/commit/bb852eadb69ab9fd7d30a9b7588b2a1dba3da89b Merge: https://github.com/mozilla-b2g/gaia/commit/16cc555fd45f796295b82d494534246eaf938529 I think we're good here for now. Notifications API is a major API rewrite that will require its own bug, TAG_OPTIONS is fairly isolated and can be fixed if you'll ever be doing a refactor of that code, and everything else has to wait for us to get more features in l10n API. I'm closing this bug. Thanks for all your help and reviews Jose!
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.

Attachment

General

Created:
Updated:
Size: