Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difficulty Localizing xib Files

I have localized two sets of xibs and put them in my project navigator as shown in the picture below:

enter image description here

My Localized.strings files are working fine, but the xib files are sometimes selected incorrectly. When I set the device language to French, I see the English xib view. When I set the device language to English, I see the French xib view.

I removed the xib files from the project, deleting the references only, and then dragged them back into project in the same places, as the picture shows. Right at the moment, I'm only seeing the English version, regardless of which language I have the device set to.

Is there something anyone can see that I'm doing wrong?

(I have read advice, like this one, on not using separate frames for each language. I may switch to that at some point, but right now, I just want to understand what is wrong with my set up.)

Update

Here is the file organization for the en.lproj folder. The fr.lproj folder is set up the same way. These are inside a folder called Resources. enter image description here

Update - Final Result

I experimented with the localization settings for my xib files in the panel at the right.

enter image description here

and finally noticed those disclosure buttons when I had two or more languages selected for localization. Clicking on the disclosure button revealed a xib file for each language. I then had redo the localization for the foreign language xib. (I probably could have copied and pasted from the existing xibs.)

So the files are now organized like this:

enter image description here

like image 537
Jim Avatar asked Jan 08 '12 03:01

Jim


1 Answers

The project navigator shows the en.proj and fr.proj, but are the files really localized in folders on the file system? In XCode 4.2 the localized files will show there localization after the file name in parentheses. I do not see that in your example. Here is what my localized resources look like.

enter image description here

To make the XIB localized you need to put them into folders on the file system with the appropriate names. It is easiest to do this from the file inspector.

enter image description here

Don't know if this helps?

like image 52
smmelzer Avatar answered Oct 04 '22 01:10

smmelzer