2011-09-29 218 views

回答

0

您是否使用「-j」選項?它生成java本地化字符串(其格式爲%1 $ @)。

[編輯]

對不起,看着錯誤的手冊頁。請使用選項-noPositionalParameters來關閉位置參數的生成。 - >Info's here

0

因爲%[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]"