-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Disambiguate "Dismiss" localizations #19028
Comments
I have a demo for the reverse-DNS approach: #19029 |
I think we should actually adopt a mix of both your suggestions, so that we have both the ability to provide a different translation of "Dismiss" for each of the 20 places based on context… and ensure consistency (between subtitle and button title on that screen) via code, instead on assuming the translator(s) will know the relation between those two strings. static let subtitle = NSLocalizedString(
"qr_code_login.verify_authorization.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(
"qr_code_login.verify_authorization.dismiss_button",
value: "Dismiss",
comment: "Button label that dismisses the qr log in flow and returns the user back to the previous screen"
) |
@AliSoftware I've been thinking about this and I agree with you. Even though interpolation feels a bit clunky, the translators are familiar with it already and it's the most secure way to ensure consistency. |
#19635 closed this issue, but I forgot to followup or to use one of GitHub's option to close this as it got merged. |
Problem
While smoke testing version 20.2, sharp eyed @tiagomar noticed an issue. In the QR code login screen, the English copy for the message and button are "Tap dismiss and..." and "Dismiss" respectively, but the Italian translation was inconsistent:
This happened because there is no clear relationship between the "Dismiss" used in the message and the one used in the button, so it's up to the translator or translators that happened to pick up the string to use the translation they think makes more sense given the limited context provided by the developer comment.
To make matter worse, we have 20 usages of the "Dismiss" across the app:
WordPress-iOS/WordPress/Resources/en.lproj/Localizable.strings
Lines 2508 to 2528 in b9e7595
While "Dismiss" might work in English in all those instances, we cannot assume whichever translation "Dismiss" happens to have in one locale is appropriate in all the instances for that locale as well. As a matter of fact, that is exactly the case for the Italian locale, where "Dismiss" got translated to "Respinto" ("Reject"), but then translated to "Ignora" ("Ignore") in the context of the "Tap dismiss and..." copy for the QR code screen.
Proposed Solution
We need to disambiguate between the various context in which "Dismiss" is used.
One option would be to use replace each
NSLocalizedString("Dismiss", "...")
definition with ones using reverse DNS notation for the key, e.g.NSLocalizedString("qr_code_login.verify_authorization.dismiss_button", "...")
. This approach would result in dedicated entries for each "Dismiss" usage and should give translators more flexibility.This approach (kudos @AliSoftware for making it happen) is already in use, for example in
StatSection.swift
:WordPress-iOS/WordPress/Classes/ViewRelated/Stats/Helpers/StatSection.swift
Line 408 in ac84f8a
If we had this setup in place at the time of the issue described above, we could have fixed the translation for the button and message in the QR code screen to be in line and consistent, that is with a better Italian translation that actually signifies dismiss, like "Dismetti". Instead, we had to edit the message translation to use "Respinto" because we couldn't risk changing the button translation as it was used in 19 other screens.
And alternative to ensure consistency, albeit without extra flexibility, would be to use string interpolation:
The text was updated successfully, but these errors were encountered: