[ACCEPTED]-What is the second parameter of NSLocalizedString()?-localization
The second parameter is a comment that will 7 automatically appear in the strings file 6 if you use the genstrings command-line utility, which 5 can create the strings file for you by scanning 4 your source code.
The comment is useful for 3 your localizers. For example:
NSLocalizedString(@"Save",@"Title of the Save button in the theme saving dialog");
When you run 2 genstrings, this will produce an entry in 1 the Localizable.strings file like this:
/* Title of the Save button in the theme saving dialog */
"Save" = "Save";
The comment string is ignored by the application. It 11 is used for a translator's benefit, to add 10 meaning to the contextual usage of the key 9 where it is found in your application.
For 8 example, the Hello_World_Key
key may take different values 7 in a given language, depending on how formal 6 or informal the Hello World
phrase needs to be in that 5 language ("What's up World", "Yo World", "Good 4 Day World", etc.).
You can add a string in 3 the comment field to hint this usage to 2 the translator, who will (one would presume) be 1 better able to localize your application.
It's for just developer understanding on 5 the translation, that is you are giving 4 a key to get corresponding string from the 3 corresponding strings file.
The comment parameter 2 enables developer to understand what the 1 key represents...
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.