-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api-minor] Use "data-l10n-id"/"data-l10n-args", rather than manually updating DOM-elements, to trigger translation (PR 17146 follow-up) #17141
Conversation
@calixteman Does this make sense to do, as a general pattern, where possible in the viewer? |
Yep it makes sense as a general pattern: it makes the code simpler. |
72e9b5d
to
b6955ac
Compare
b6955ac
to
bb4bbdf
Compare
bb4bbdf
to
f7bc8d2
Compare
e453e16
to
c5ecdd7
Compare
5ee9225
to
a458574
Compare
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/3d4f7233987275c/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/118643ab5050634/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/118643ab5050634/output.txt Total script time: 24.82 mins
Image differences available at: http://54.241.84.105:8877/118643ab5050634/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/3d4f7233987275c/output.txt Total script time: 36.01 mins
Image differences available at: http://54.193.163.58:8877/3d4f7233987275c/reftest-analyzer.html#web=eq.log |
a458574
to
b44387f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this impacts the migration in https://phabricator.services.mozilla.com/D190941
It might be a completely pointless micro-optimization, but one thought that occurred to me is that we could probably build the l10n-args "manually" using template strings and thus avoid the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, with the comment below addressed, but I'd like @calixteman to also sign off on this given that the Fluent migration also needs to be adapted. I think it's great that we can avoid all parameter passing here now!
… updating DOM-elements, to trigger translation (PR 17146 follow-up) This patch changes almost all viewer-components[1] to use "data-l10n-id"/"data-l10n-args" for localization, which means that in many cases we no longer need to pass around the `L10n`-instance any more. One part of the code-base where the `L10n`-instance is still being used "directly" is the AnnotationEditors, however while it might be possible to convert (most of) that code as well that's not attempted in this patch. --- [1] The one exception is the `PDFDocumentProperties` dialog, since the way it's currently implemented makes that less straightforward to fix without a lot of code changes.
b44387f
to
17af706
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I'll update the migration recipe in m-c to take into account the new changes here.
This patch changes almost all viewer-components[1] to use "data-l10n-id"/"data-l10n-args" for localization, which means that in many cases we no longer need to pass around the
L10n
-instance any more.One part of the code-base where the
L10n
-instance is still being used "directly" is the AnnotationEditors, however while it might be possible to convert (most of) that code as well that's not attempted in this patch.[1] The one exception is the
PDFDocumentProperties
dialog, since the way it's currently implemented makes that less straightforward to fix without a lot of code changes.