1

I have a curious problem ...

I created a new project with xcode 5 , I deleted storyboards , since i'm working with xibs , and I removed the base localization because , from what I've read, it's useless with the xibs . I also eliminated the English localization and added the Italian one , which is what interests me.

I started working with the device (which is set in Italian ) and everything works properly.

This morning , having forgotten the cable at home, I decided to use the simulator (which is set in English) and the app crashed . After some tests I realized that the problem stems from the language settings , in fact if I set the language of the simulator in Italian , everything works properly. Analyzing the situation better , I realized that some variables set in the file " Localizable.strings " and crucial for the application are not read correctly ( it sets the key and not the value ) and for this reason the app crashes .

I'm pretty confident i can solve the problem by simply creating a new project and copying in the code, but I would like to know if it is possible to recover the original.

Any help will be appreciated thanks

EDIT:

1st Try: Checked the button base localization in project/info is opening an empty popup window (no files to localize)

2nd Try: In project/info, under localization press "+" to add base localization (i have only italian now) seems nothing changed ... it still open an empty window

Follow some screenshots

The Italian Localization

As u can see there is 1 file localized, wich is the Localizable.strings, and the check button "Use base Internationalization" unchecked.

Base Localization Window

Here u can see what happen either when i check "Use base Internationalization" or i add the Base language by pressing the "+" button under "Localizations".

EDIT 2:

Tryed same things with iOS Deployment Target 7.0 instead of 4.3. Same Result

Alex75
  • 527
  • 6
  • 20

3 Answers3

1

Resolved. The problem arose from the fact that I had installed on the simulator an old version of Localizable.strings file as indicated in the post here.

The strange thing is that I was pretty sure I deleted and restarted the app more times before I read that post, as it is a practice that I adopt often well aware of the behavior described in the post.

Edit:There was no need, as I thought, add the Base Localization

Community
  • 1
  • 1
Alex75
  • 527
  • 6
  • 20
1

Your problem is likely that the MainMenu.xib needs to be registered as a localizable resource.

  1. Select MainMenu.xib in the Project Navigator (left sidebar)
  2. If a Localize... button appears in the File Inspector (right sidebar), press it.
  3. Tick the Use Base Internationalization checkbox. This time MainMenu.xib should appear.

Now when you tick additional languages for MainMenu.xib in the File Inspector, Xcode will create a MainMenu.strings file for that language. Click the disclosure triangle on MainMenu.xib in the Project Navigator to edit it.

  • Hi, I got the corresponding .string files for my xibs, but the text is not changing on changing the language. Can you help me out. – Mahesh Dec 01 '14 at 12:42
0

When working with Localization you need a base language, one that can be used if the language the device wants to use is not present. If no file can be found it will use the key. One trick, since keys can be a sentence, is to let your key be the your base language.

Peter Segerblom
  • 2,773
  • 1
  • 19
  • 24
  • Tanks for the answer. I had tryed to add base localization (by checking the appropriate button in project summary) again to my project. The problem is that i don't see any localizable file in the popup window. Maybe i'm forgetting to do something? – Alex75 Oct 15 '13 at 10:03
  • In xcode 5 there is a checkbox where you set localization. Click Project and Info and its at the bottom. Also if you click '+' sign and go to "other" there is a option named "Base". Try that if you already have not. – Peter Segerblom Oct 15 '13 at 17:42
  • @PeterSegerblom: I can not find such option as "Base" in list under Localizations. Using Xcode6 beta5 – BaSha Aug 13 '14 at 09:10