I am just wondering what the second parameter to NSLocalizedString
is used for.
cell.textLabel.text = NSLocalizedString(@"Detail", @"Detail");
I am just wondering what the second parameter to NSLocalizedString
is used for.
cell.textLabel.text = NSLocalizedString(@"Detail", @"Detail");
The first string in NSLocalizedString
is what will be printed as the string you want the user to see. This can also be a key for Localizable.strings.
The second parameter is like a description, or comment for this string.
You can use the genstrings
command-line utility, which can create the strings file for you by scanning your source code and finding NSLocalizedString
's.
How to use genstring
: http://steelwheels.sourceforge.jp/Documents/genstring.html
NSLocalizedString(@"SomeStringKey",@"An example of how to use this string.");
/* An example of how to use this string. */
"SomeStringKey" = "An Example String";
The second parameter to
NSLocalizedString
is a comment used to describe the text such as where it is used. Whengenstrings
is used to create the base .strings file the comment helps a localizer understand the context.