因爲%[email protected]
引用了給你的格式字符串的第一個參數,所以你不需要改回它。
實際上,在與您不同的情況下,可能會發生參數的順序從翻譯變爲另一個。例如,如果你的代碼使用的格式來顯示像一些玩家的屬性值:
let fmt = NSLocalizedString("Player property value", comment: "The player property value")
String(format:fmt, playerName, playerProperty, value)
您可能必須在「en.lproj/Localizable.strings」:
/* The player property value */
"Player property value" = "Player %[email protected]'s %[email protected] is %3$d"
,並在「 fr.lproj/Localizable.strings「:
/* The player property value */
"Player property value" = "Le %[email protected] du joueur %[email protected] is %3$d"
或:
/* The player property value */
"Player property value" = "Le joueur %[email protected] a %3$d points de %[email protected]"