0
當我們將文件提供給翻譯人員時,我們發現評論消息非常有用。對於Android應用程序,有沒有辦法在strings.xml中爲翻譯器添加註釋消息?如何在android翻譯文件中添加註釋
// In the strings.xml
<string name="hello___">Hello %1$s</string>
在iOS上,我們可以這樣做:
// In the code, when we export the translation file to xliff,
// The comments in `NSLocalizedString` will be collected and inserted into the xliff file
NSString *greetingMessage = NSLocalizedString(@"hello__",
@"A simple greeting messsage, %@ will be replaced by user's name");
// In the Localizable.strings file
"hello__"="hello %@";
在Windows中,我們可以這樣做:
// In the Resources.resw file:
<data name="hello__" xml:space="preserve">
<value>Hello {0}</value>
<comment>{0} will be replace by user's name</comment>
</data>
試< - 在這裏評論! - > – Bill
@quidproquo感謝您的評論!它的工作原理! –