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
Fix localization keys for local account names in Account package #3991
Conversation
|
@stuartbreckenridge As the localization expert, would you review this PR? |
|
Account Names are currently localized via the main app's func localizedAccountName() -> String {
switch self {
case .onMyMac:
let defaultName: String
#if os(macOS)
defaultName = NSLocalizedString("account.name.mac", comment: "On My Mac")
#else
if UIDevice.current.userInterfaceIdiom == .pad {
defaultName = NSLocalizedString("account.name.ipad", comment: "On My iPad")
} else {
defaultName = NSLocalizedString("account.name.iphone", comment: "On My iPhone")
}
#endif
return defaultName
/* The below account names are not localized as they are product names. */
case .bazQux:
return "BazQux"
case .cloudKit:
return "iCloud"
case .feedbin:
return "Feedbin"
case .feedly:
return "Feedly"
case .freshRSS:
return "FreshRSS"
case .inoreader:
return "Inoreader"
case .newsBlur:
return "NewsBlur"
case .theOldReader:
return "The Old Reader"
}
} |
|
@stuartbreckenridge Does that mean this PR should be closed? |
|
Yes. For the moment, they are localized in the app. |
|
But they are not? NSLocalizedString is looking for the “On My X” keys in the Localizable.strings file, which do not exist. It’s not noticeable in the English localization because it uses the key as a fallback. |
|
If we take this code from Text(verbatim: AccountType.onMyMac.localizedAccountName())The |
|
Note that there is a |
|
I’m not sure we’re talking about the same thing? This PR is not about localizedAccountName, that one works fine (because it uses the correct keys), I never doubted that. |
|
That's my point @J-rg — we do not need to localize the account names in the Account package just now because it's handled in the main app. If that changes in the future, this PR is 100% correct in that we'd need to re-key the strings in code, but we'd also need to add translations in the Account package's |
|
Okay, I think I see where the misunderstanding is. |
|
@brentsimmons Let's approve this. @J-rg has valid points and this is an additive PR. I will do some follow-up work to move Account name-related localizations from the main app to the Account package. |
No description provided.