Juanjo
Juanjo

Reputation: 969

Configuration file for my app's texts

I am developing an app for iOS and I'd like to have all of the strings from my app in one file, so I can have them localized just in case I'd want to change them quickly and have the same texts than the android version. How could I do it? Thanks in advance

Upvotes: 0

Views: 43

Answers (1)

James Paolantonio
James Paolantonio

Reputation: 2194

All you need to do is create a string localization file and then put all the string you would like to localize in that one file. You can then create extra string localization files for each additional language.

Here is a good link that shows how to create an implement a strings file. http://www.raywenderlich.com/2876/how-to-localize-an-iphone-app-tutorial

Basically, instead of calling something like

label.text = @"Enter password";

You do

label.text = NSLocalizedString(@"ENTER PASSWORD", nil);

You're string file in this example would look like

"ENTER PASSWORD" = "Enter password";

Upvotes: 2

Related Questions