6

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

Community
  • 1
  • 1
Jim
  • 5,940
  • 9
  • 44
  • 91

1 Answers1

1

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?

smmelzer
  • 230
  • 2
  • 10
  • Thanks. I'm not sure how to accomplish that. I have other localized string files (referred to by name in my code), and they appear the same way as my localized.strings files shown here. – Jim Jan 15 '12 at 04:29
  • I could set the Localization for each xib to either English only or English and French. If tried different combinations and still am getting the wrong xib for the language setting of the device. I can't set the localization of the French xib to French only. Deleting English from it when it is set to English and French is not an option. The minus sign is grayed out if I select English to delete. – Jim Jan 15 '12 at 04:37
  • Jim, Get rid of the xib directories in the languages and see what happens. I have never nested resources and am not sure if this might be causing some iOS weirdness. – smmelzer Jan 15 '12 at 17:17
  • I might have to consider doing this with the Localized.strings files, too. I don't quite understand the need for the .lproj folders now, after seeing your example includes localized html files, too. – Jim Jan 15 '12 at 19:43