Christian
Christian

Reputation: 526

xcode 6 iOS launchScreen.xib localization issue

In my app I have three languages. The launchScreen.xib has three localzations too.

enter image description here

Like the localizable.strings I changed the text that should be used by the Object-ID.

enter image description here

When launching the App there is always the english text used, not the localized. And there is a "X" int he symbol of the LaunchScreen.xib and LaunchScreen.xib (Base). Why? How can I solve that issue?

Upvotes: 15

Views: 3968

Answers (5)

Constantine
Constantine

Reputation: 781

Fawkes' answer is the right one:

  1. Create InfoPlist.strings file. (File,New,Resource,Strings)
  2. Localize it and add the key "UILaunchStoryboardName" with the value being the name of the xib you want to be shown as the launchscreen for that localisation.

One thing to note is that, all the launch screen storyboards that you'll end up having need to be barked as "Base localization" in the Files Inspector:

enter image description here

If you accidentally mark them as a localization for a different language, it will not work (it will just display a black screen!)

Upvotes: 0

Truong Le
Truong Le

Reputation: 111

As Apple's document, launchscreen will never locale your text:

"Avoid including text on your launch screen. Because launch screens are static, any displayed text won’t be localized."

https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/

Upvotes: 4

Dmitry
Dmitry

Reputation: 11

I would like to give clear description of fix according to previous info. I got the same issue and couldn't find clear description. I have Xcode 8.2.1 and Swift 3.0 now. Finally: I copied LaunchScreen.storyboard and added it to project with name Launch_ru.storyboard. After I did localization of Launch_ru.storyboard. Next need to choose it and add Base Localization. Next need to add to added during main localization file InfoPList.string key "UILaunchStoryboardName" = "Launch_ru"; where Launch_ru is name of my new Launch_ru.storyboard. These three actions fixed my issue.

Upvotes: 0

Fawkes
Fawkes

Reputation: 3941

The correct answer to specifically localizing the launch screen is here:

Localization of Default.png is not working

And for shortcutting I'll paste the main steps:

  1. Create InfoPlist.strings file. (File,New,Resource,Strings)
  2. Localize it and add the key "UILaunchStoryboardName" with the value being the name of the xib you want to be shown as the launchscreen for that localisation.

For e.g. for the Spanish version, add your launch screen key and name for the Spanish version of your Launch screen in the newly created InfoPlist.strings localized for spanish.

"UILaunchStoryboardName" = "Launch_es";

Upvotes: 9

Noor
Noor

Reputation: 2067

I had same issue, after that i used MCLocalization it is very easy to integrate in your app. It worked perfectly for me

Upvotes: -1

Related Questions