如何本地化启动屏幕 [英] How to localize launch screen
问题描述
我已经本地化了LaunchScreen.xib
,通过它可以将LaunchScreen分为两部分.
I have localized LaunchScreen.xib
, through which the LaunchScreen is divided in two parts.
即 LaunchScreen.xib(英语)和 LaunchScreen.xib(葡萄牙语),但是当我将设备语言更改为葡萄牙语时,也会加载LaunchScreen.xib(English)
.
i.e. LaunchScreen.xib(English) and LaunchScreen.xib(Portugese), but when I change device language to Portuguese then LaunchScreen.xib(English)
is also loaded.
推荐答案
-
从项目的添加新文件"菜单中为每种语言添加多个"LaunchScreen.storyboard". (让我们说西班牙语-启动Screen_sp)
Add multiple "LaunchScreen.storyboard" for each language from "Add New File" menu in project. (Lets say for spanish - Launch Screen_sp)
从身份检查器菜单中将"Info.plist"本地化为想要使用的每种语言的InfoPlist.strings(基本),InfoPlist.strings(西班牙语).
Localize your "Info.plist" from identity inspector menu as InfoPlist.strings (Base) , InfoPlist.strings(Spanish) for each language you want to use.
现在作为示例:在InfoPlist.strings中(西班牙语) 添加以下密钥:
Now as example: in InfoPlist.strings (spanish) add following key :
"UILaunchStoryboardName" ="LaunchScreen_sp";
"UILaunchStoryboardName" = "LaunchScreen_sp";
您就完成了.不要忘记在项目的常规"设置中将"LaunchScreen"设置为启动屏幕文件.
and you are done. Do not forget to set "LaunchScreen" as your Launch Screen File in "General" settings of your project.
这篇关于如何本地化启动屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!