I have localized LaunchScreen.xib
, through which the LaunchScreen is divided in two parts.
i.e. LaunchScreen.xib(English) and LaunchScreen.xib(Portugese), but when I change device language to Portuguese then LaunchScreen.xib(English)
is also loaded.
Go to storyboard and click on UI Element that you want to localize. Select identity inspector, In Document portion you will see Object ID that we need to use for localize that element. Now goto localization file that created from step 3. In that string file you will see Object ID of elements.
If your project doesn't contain a default launch screen file, add a launch screen file and set the launch screen file for the target in the project editor. Choose File > New > File. Under User Interface, select Launch Screen, and click Next.
Now, to add new languages, go to your project's settings, under the Info tab, click on + to add a new language, and select the files you want to localize. Your file is now localized. You can select in wich language you want to write by selecting the localized Localizable.
Add multiple "LaunchScreen.storyboard" for each language from "Add New File" menu in project. (Lets say for spanish - Launch Screen_sp)
Localize your "Info.plist" from identity inspector menu as InfoPlist.strings (Base) , InfoPlist.strings(Spanish) for each language you want to use.
Now as example: in InfoPlist.strings (spanish) add following key :
"UILaunchStoryboardName" = "LaunchScreen_sp";
and you are done. Do not forget to set "LaunchScreen" as your Launch Screen File in "General" settings of your project.
The answer is: you cannot localize launch screen
In the Human Interface Guideline, they pointed out:
Avoid including text on your launch screen. Because launch screens are static, any displayed text won’t be localized.
Text cannot be localized.
What about images?
I have tried localising, and as of April 2017, I concluded that localization doesn't work. The localized storyboard will be ignored.
As user: Samewize pointed out, the User Interface Guidelines advise against localizing text on the Launch Screen.
Avoid including text on your launch screen. Because launch screens are static, any displayed text won’t be localized.
To add to that, as of September 2019, even with localization of asset catalogs (WWDC 2019 Video), I've been unable to localize images that appear on the Launch screen. I'm assuming the Launch screen is statically generated and does not take Localization into account.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With