Localization in iOS

suggest change

Create an individual Localizable.strings file for each language. The right side would be different for each language. Think of it as a key-value pair:

"str" = "str-language";

Access str in Objective-C:

//Try to provide description on the localized string to be able to create a proper documentation if needed
NSString *str = NSLocalizedString(@"str", @"description of the string");

Access str in Swift:

let str = NSLocalizedString("str", comment: "description of the string");

The lookup key has to match the left-hand side of the strings file. If that key is missing for the user’s language, NSLocalizedString returns the key itself.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents