1

I'm looking at some example of using NSLocalizedString and there is a .string file in project where i can find:

"Loading" = "Wczytuję...";

And then in a app code i can find:

return NSLocalizedString(@"Loading", @"");

How can i create multilanguage version of my app using that? Or there is a other way?

I want to have button to change language.

Jakub
  • 13,712
  • 17
  • 82
  • 139

1 Answers1

1

That's exactly how you localize an iOS app. Everywhere where you want to show some localized text you write NSLocalizedString(@"Something", @"Optional Description"). Then you add a file called Localized.strings to your app's resources and translate the text there:

"Something" = "Something in other language";

You can add new languages by selecting the .strings file and on the right side of XCode add a new language:

enter image description here

You can also have additional, separate .strings files in your project. Then you have to specify where to look for a translation: NSLocalizedStringFromTable(string, filename, comment)

DrummerB
  • 39,814
  • 12
  • 105
  • 142
  • As i said - i don't want to do it by localization, i like to have button to change language. – Jakub May 14 '12 at 15:24
  • You might want to make that clear in your question then. See this: http://stackoverflow.com/questions/5109245/changing-language-on-the-fly-in-running-ios-iphone-app – DrummerB May 14 '12 at 15:35