views:

27

answers:

1

Hello,

I am trying to make my app localized. I have followed this procedure http://www.switchonthecode.com/tutorials/a-simple-localization-example-for-the-iphone. And have deleted all localization and done it over again. I've seen other tutorials with exactly the same procedure.

My view to localize is named InfoView.xib.

I have:

  1. rigth-clicked InfoView.xib->Get info -> Make File Localizable
  2. added Localization and named it to "sv" (for Swedish language)
  3. edited the sv-xib

When the simulator is set to English or any other language, I do get the xib loaded and can present it. But when setting the simulator to Swedish language, the view is not instantiated.

When doing

NSLog(@"Language: %@ ",[NSLocale preferredLanguages]); 

I do get "sv" as the top language code.

("NSLog(@"Locale: %@ ",localeString);" gives "sv_SE")

When trying this

[[NSBundle mainBundle] loadNibNamed:@"InfoView" owner:self options:nil];
NSLog(@"InfoView in loadView %@", infoView);

It prints "(null)" when simulator is set to "Swedish" but instanstiate with any other language.

This is my setting if I do Get info on my sv-xib, in case it matters:

alt text

I have done the cleant targets and did reset the simulator.

What can the problem be? And how is the mapping done between the name I choose when adding a locale (sv) and the simultar/device language setting? Is it the acutal "sv" I named my locale to that must match the device's language code ("sv" is one)?

Thanks in advnace!

/Niklas

A: 

And 30s after I posted this a thought struck me; "Why don't I check if the localized view in IB is linked to the outlet in my File's Owner"...

It wasn't... Perhaps the tutorials should mention that the new localized xib must be linked as well. And really, why isn't this done automatically...?

"Thank you Nicsoft!"

"You're welcome!"

Nicsoft
:) Classic case of rubber-ducking.
chryss