Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my XIB file not localize (iPhone)?

Situation: I am starting XCode, creating a new project for the iPhone (view application) and loading the XIB file into the IB. I manipulate the view (adding a label with the string "hello"), save, build, run the application, everything is fine. Now i am localizing the XIB. What i do: right-click on the xib-file, adding the desired language and after that, i have two XIB files in my XCode. Looks absolut perfect, just as it is shown in my iPhone Programming book ("the big nerd ranch"). I do change the label in both XIBs to another string, lets say "good morning!".

Problem: Now i clean and rebuild the application - but it allways shows the old XIB-file, allways the string "hello". Even when i change the settings on the iphone to other languages, i allways get the "hello" string shown. But the XIB with "hello" does not exist in my xcode anywhere!

Any hints for me? It makes me go crazy - and i just hope that i am missing a simple thing.

I am using XCode 3.2.3 and SDK 4.0

Thanks a lot in advance!

like image 327
peace97 Avatar asked Oct 12 '10 22:10

peace97


1 Answers

There are a a few steps to follow, including:

  • ibtool --generate-strings-file Example.strings en.lpoj/Example.xib
  • genstrings -o en.lproj *.m
  • translating the resource file
  • ibtool --strings-file fr.lproj/Example.strings en.lproj/Example.xib –write fr.lproj/Example.xib
  • dragging the translated resource file to the project (in the exact right place).

Have a look at this iPhone localization tutorial for the full steps + screenshots.

like image 161
ICanLocalize Avatar answered Sep 19 '22 23:09

ICanLocalize