-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update various localized strings to use reverse-DNS keys #19635
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
Conversation
This is to make the diff of the next commit, where we'll add the reverse-DNS keys cleaner.
This is to make the diff of the next commit, where I'll add reverse-DNS keys, cleaner.
...Classes/ViewRelated/QR Login/View Controllers/QRLoginVerifyAuthorizationViewController.swift
Outdated
Show resolved
Hide resolved
|
|
||
| private enum Strings { | ||
|
|
||
| static let viewsCountDescriptionSingular = |
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.
If the diff in this this file is too noisy because of the formatting and indentation changes, checkout the isolated commit that adds the reverse-DNS keys 9162d30 (#19635)
| private static let subtitleFormat = NSLocalizedString( | ||
| "qrLoginVerifyAuthorization.completedInstructions.subtitle", | ||
| value: "Tap '%@' and head back to your web browser to continue.", | ||
| comment: "Subtitle instructing the user to tap the dismiss button to leave the log in flow. %@ is a placeholder for the dismiss button name." | ||
| ) | ||
| static let confirmButton = NSLocalizedString( | ||
| "qrLoginVerifyAuthorization.completedInstructions.dismiss", | ||
| value: "Dismiss", | ||
| comment: "Button label that dismisses the qr log in flow and returns the user back to the previous screen" | ||
| ) | ||
| static let subtitle = String(format: subtitleFormat, Self.confirmButton) |
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.
See my comment in the commit: ea70a12#comments
|
Since the localized string keys are changed, I'm guessing the Localizable.string files would also be changed to use the updated keys. But I don't see those files in this PR, is it because we only update them during the release process? |
crazytonyli
left a comment
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.
![]()
Another unrelated note. I did a quick search of how many localized strings are stored as static variables, and the result is 1393, which feels like too many strings to store in memory, it might be valuable to use a computed property instead?
$ ag 'static let \w* = NSLocalizedString' --no-filename | wc -l
1393
| "growAudienceCell.viewsCount.plural", | ||
| value: "Views to your site so far", | ||
| comment: "Description for view count. Singular." | ||
| ) |
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.
Unrelated to this PR, but it might be worth to explore using .stirngsdict to localize plurals.
You can test the changes in Jetpack from this Pull Request by:
|
You can test the changes in WordPress from this Pull Request by:
|
Yes, as part of the We do that only at code freeze time so that we upload a single batch of new strings to GlotPress. |
See #19028.
In previous PRs, I only touched the "Dismiss" localized string. In this one, I tried to set a better example and update all the localized strings usages in the context where the "Dismiss" one was.
This should be the last PR in the #19028 series.
Regression Notes
RELEASE-NOTES.txtif necessary. N.A.