Xcode i18n
Xcodei18n
Vorbereitungen
- Select Project -> Info -> Localisation: Gewünschte hinzufügen
- Select Project -> Product -> Export Localisation (From MainMenu)
- Open xliff file with appropriate app
- Translate
- Editor -> Import
Coding
String(localized: "YOUR_LOCALIZED_KEY")
NSLocalizedString("Abenteuer", comment: "") String(format: NSLocalizedString("%d Units in: %@", comment: ""), inventoryItem.amount, inventoryItem.place.title)
Pluralisation
String.localizedStringWithFormat(NSLocalizedString("%d unit(s) in: %@", comment: "Message for stock in place"), self.amount, self.place.title) 1. Neue plist erzeugen und in "Localizable.stringsdict" umbenennen 2. Vorlage verwenden 3. Stringsdict localisieren
Vorlage:
<plist version="1.0"> <dict> <key>%d file(s) remaining</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@files@</string> <key>files</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> <string>%d file remaining</string> <key>other</key> <string>%d files remaining</string> </dict> </dict> </dict> </plist>
Referenzen:
元等級
★★★★★
- 日期
- 2020年3月21日超過 4 年前
- 語言
- de
- 更新於
- 2024年10月19日