DarkLeafyGreen
DarkLeafyGreen

Reputation: 70466

How to localize view in xcode4?

I want to localize my iOS project in xcode4. In xcode4 this seems to be very simple. In the utility sidebar there is a localization panel where I can add languages.

Adding a language I get following structure:

enter image description here

I want to localize a button. So I open MainWindow.xib (German) and just edit the title of the button. But when I run my project on both device or simulator I always get the english version even if it is set to German.

Where is the problem? Any ideas?

Upvotes: 0

Views: 2183

Answers (2)

Matthias Bauch
Matthias Bauch

Reputation: 90117

Delete the app from the device or simulator. If you've launched it before you've added the localization there is still a MainWindow.xib in the root file structure of the project.
If you deploy from Xcode files are only added, never removed.

So you have three files now.

MainWindow.xib 
de.lproj/MainWindow.xib 
en.lproj/MainWindow.xib 

And as long there is a file in the root folder iOS doesn't look into the language specific folders.

Upvotes: 2

Hiltmon
Hiltmon

Reputation: 1265

Go into settings on the iPhone or Simulator and change the International from English to German, then restart the app.

Upvotes: 0

Related Questions