Page MenuHomePhabricator

Bug 1818612 - reduce SDP history real estate in about:webrtc;r?mjf!,dbaker!
ClosedPublic

Authored by ng on Feb 28 2023, 7:53 PM.
Referenced Files
Unknown Object (File)
Mon, May 5, 7:35 PM
Unknown Object (File)
Thu, May 1, 7:18 AM
Unknown Object (File)
Thu, May 1, 7:18 AM
Unknown Object (File)
Sat, Apr 26, 12:45 AM
Unknown Object (File)
Thu, Apr 17, 10:10 AM
Unknown Object (File)
Thu, Apr 17, 10:10 AM
Unknown Object (File)
Wed, Apr 16, 11:11 PM
Unknown Object (File)
Wed, Apr 16, 11:11 PM
Subscribers

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable
Build Status
Buildable 513007
Build 609476: arc lint + arc unit

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
ng retitled this revision from Bug 1818612 - reduce SDP history real estate in about:webrtc;r?mjf! dbaker! to Bug 1818612 - reduce SDP history real estate in about:webrtc;r?mjf!,dbaker!.
ng edited the summary of this revision. (Show Details)
flod requested changes to this revision.Feb 28 2023, 8:16 PM

Sorry, but we shouldn't ask ~100 locales to retranslate all the strings for sake of having consistent IDs.

The other issue is generating IDs at run-time. This is not considered best practice, because (among other things) it creates maintainability issues: you won't find the string ID anywhere in the code, and if you need to change the string in the future you'd still need to add code to accommodate for that.

You can still generate an internal ID, but then have a map to connect that internal ID to a fully formed Fluent message ID.

toolkit/locales/en-US/toolkit/about/aboutWebrtc.ftl
271

Fluent supports group level comments (with two hashes). This comment should apply to both strings, not just the one following.

https://projectfluent.org/fluent/guide/comments.html

Not strictly relevant for localization, but I don't think it's common practice to have lowercase labels in buttons?

This revision now requires changes to proceed.Feb 28 2023, 8:16 PM
ng requested review of this revision.Feb 28 2023, 10:29 PM
ng updated this revision to Diff 687305.
ng marked an inline comment as done.Feb 28 2023, 10:31 PM
ng added inline comments.
toolkit/locales/en-US/toolkit/about/aboutWebrtc.ftl
271

Thank you, and thanks for the link!

ng marked an inline comment as done.Feb 28 2023, 10:33 PM

Sorry, but we shouldn't ask ~100 locales to retranslate all the strings for sake of having consistent IDs.

The other issue is generating IDs at run-time. This is not considered best practice, because (among other things) it creates maintainability issues: you won't find the string ID anywhere in the code, and if you need to change the string in the future you'd still need to add code to accommodate for that.

You can still generate an internal ID, but then have a map to connect that internal ID to a fully formed Fluent message ID.

Ah, thanks. I'll address those issues.

Code analysis found 1 defect in the diff 687305:

  • 1 defect found by fluent-lint (Mozlint)
IMPORTANT: Found 1 issue (error level) that must be fixed before landing.

You can run this analysis locally with:

  • ./mach lint --warnings --outgoing

If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 687305.

1 issue closed compared to the previous diff 687305.


If you see a problem in this automated review, please report it here.

I like how this looks and it makes looking at the remote/local sdp more pleasant. Nice!

@flod, I believe this addresses your concerns. If I were to fix the capitalization of the other "hide" "show" strings, will that likewise cause similar amounts of localization churn? Would it make any difference in induced labor if I were to correct all of those in their own patch? Would it be preferable for me to do that here?

toolkit/content/aboutwebrtc/aboutWebrtc.css
169

This yellow makes the white text difficult to read when using dark mode. Maybe a different color or having the text be a dark color could help.

ng marked an inline comment as done.Mar 1 2023, 1:50 AM
In D171263#5635177, @ng wrote:

@flod, I believe this addresses your concerns.

Thanks, this looks good.

If I were to fix the capitalization of the other "hide" "show" strings, will that likewise cause similar amounts of localization churn?

I missed there were already other lowercase button labels.
https://searchfox.org/mozilla-central/search?q=-show-&path=aboutWebrtc.ftl&case=false&regexp=false

Normally capitalization changes don't require new IDs and retranslation, but in this case we would need to signal locales to avoid inconsistencies, and that can only be done by changing the IDs. At this point, I would use lowercase for these new labels as well (like you did initially), and keep the page consistent.

Would it make any difference in induced labor if I were to correct all of those in their own patch? Would it be preferable for me to do that here?

I assume with "all of those" you mean the English labels, not the localized ones? If we want to fix them, there's no way to avoid churn.

Normally capitalization changes don't require new IDs and retranslation, but in this case we would need to signal locales to avoid inconsistencies, and that can only be done by changing the IDs. At this point, I would use lowercase for these new labels as well (like you did initially), and keep the page consistent.

And now I just saw the email for D171306, which introduces 2 other strings that could be capitalized, making it potentially 5 uppercase (Show tab is already inconsistent), and 3 lowercase.

At this point, let's keep this patch as is, and fix the remaining 3 labels with a new IDs. Feel free to tag me for reviewing that patch.

This revision is now accepted and ready to land.Mar 1 2023, 6:34 AM