mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 09:18:18 +00:00
Fixes #4322 - Device names are handled via l8n
Added a `DefaultAccountNames.xcstrings` file that `defaultAccountName` looks to for device names. It has a variation per device. Note that it’s “On My Apple Vision”…no “Pro” modifier.
This commit is contained in:
3 files changed
+67
-23
No files matched your search
@@ -78,18 +78,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
||||
}
|
||||
|
||||
public static let defaultLocalAccountName: String = {
|
||||
let defaultName: String
|
||||
#if os(macOS)
|
||||
defaultName = NSLocalizedString("On My Mac", comment: "Account name")
|
||||
#else
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
defaultName = NSLocalizedString("On My iPad", comment: "Account name")
|
||||
} else {
|
||||
defaultName = NSLocalizedString("On My iPhone", comment: "Account name")
|
||||
}
|
||||
#endif
|
||||
|
||||
return defaultName
|
||||
return NSLocalizedString("account.name.on-my-device", tableName: "DefaultAccountNames", comment: "Device specific default account name, e.g: On my iPhone")
|
||||
}()
|
||||
|
||||
var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "account")
|
||||
|
||||
@@ -23,17 +23,7 @@ extension AccountType {
|
||||
|
||||
switch self {
|
||||
case .onMyMac:
|
||||
let defaultName: String
|
||||
#if os(macOS)
|
||||
defaultName = NSLocalizedString("On My Mac", comment: "Account name")
|
||||
#else
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
defaultName = NSLocalizedString("On My iPad", comment: "Account name")
|
||||
} else {
|
||||
defaultName = NSLocalizedString("On My iPhone", comment: "Account name")
|
||||
}
|
||||
#endif
|
||||
return defaultName
|
||||
return NSLocalizedString("account.name.on-my-device", tableName: "DefaultAccountNames", comment: "Device specific default account name, e.g: On my iPhone")
|
||||
case .bazQux:
|
||||
return NSLocalizedString("BazQux", comment: "Account name")
|
||||
case .cloudKit:
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"sourceLanguage" : "en",
|
||||
"strings" : {
|
||||
"account.name.on-my-device" : {
|
||||
"comment" : "Device specific default account name, e.g: On my iPhone",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"variations" : {
|
||||
"device" : {
|
||||
"appletv" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "On My Apple TV"
|
||||
}
|
||||
},
|
||||
"applevision" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "On My Apple Vision"
|
||||
}
|
||||
},
|
||||
"applewatch" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "On My Apple Watch"
|
||||
}
|
||||
},
|
||||
"ipad" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "On My iPad"
|
||||
}
|
||||
},
|
||||
"iphone" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "On My iPhone"
|
||||
}
|
||||
},
|
||||
"ipod" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "On My iPod"
|
||||
}
|
||||
},
|
||||
"mac" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "On My Mac"
|
||||
}
|
||||
},
|
||||
"other" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "On My Device"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"version" : "1.1"
|
||||
}
|
||||
Reference in new issue
Block a user