Language settings for iOS apps

First of all, it is necessary to clarify the difference between two nouns: " the system language of the current phone " and " the language setting inside the application "

Scenario of the problem to be solved:

In iOS applications, some UI controls of the system are sometimes called, such as:

1. Long press in UIWebView will pop up the context menu of the system.

2. The camera interface of the system will be used in UIImagePickerController.

3. When the UITableViewCell in the compiled state is in the state to be deleted, there will be a system delete button.

Among the above UI controls, the display language is not the same as the system language of your current phone, but is displayed according to the language setting inside your application. As a result, if you don't set it properly, your Chinese application may have some English control text .

Solution:

Open the project's Info.plist file directly with vim , and add the following to the file:

<key>CFBundleLocalizations</key>
<array>
<string>zh_CN</string>
<string>en</string>
</array>

or use:

<key>CFBundleDevelopmentRegion</key>
<string>zh_CN</string>

In addition, about other keywords of Info.plist, I have compiled some online resources, and displayed them for the convenience of viewing. If you want to use them, you can use the keywords to go to Baidu.

1. Application does not run in background

(键名:UIApplicationExistsOnSuspend)

Since iOS4.0, when you press the Home button while the application is executing, the application will not interrupt the current application, but will be placed in the background.

Therefore, please check this option if you want the user to exit the current application after pressing the Home button.

 

2. Application requires iPhone environment

(Key name: LSRequiresIPhoneOS)

The iOS family of devices includes the iPhone, iPad, and iPod Touch. So if your application can only be used in the iPhone environment,

Please check this option.

 

3. Application supports iTunes file sharing

(键名:UIFileSharingEnabled)

Versions after iTunes9.1 have added a file sharing function, just open this option in info.plist,

Then put the file you want to share in the Documents directory, and you can see the file in the Applications tab in iTunes.

 

4. Application uses Wi-Fi

(键名:UIRequiresPersistentWiFi)

If your application needs to use WiFi to connect, then you can enable this feature.

When the user does not turn on WiFI when running this application, a dialog box will automatically pop up on the interface asking to turn on Wi-Fi.

 

5. Bundle creator OS Type code

(Key name: CFBundleSignature)

CFBundleSignature is a four-letter string that represents the developer's identification of the application.

For example: in a text editing application, you can identify as "ttext".

 

6. Bundle display name

(键名:CFBundleDisplayName)

The localized display name of the application, the default value is ${PRODUCT_NAME}. This function can be modified in the project setting interface that appears after double-clicking Targets,

Find "Product Name" and modify it to your product name, and the compiled .app will also be named with this name.

 

7. Bundle identifier

(Key name: CFBundleIdentifier)

The unique ID used to identify the application, usually named in reverse DNS, for example: com.myCompany.myApp,

This name should be the same as the new app ID in iTunes Connect.

 

8. Bundle name

(Key name: CFBundleName)

The short name of the application, usually your application name.

 

9. Bundle OS Type code

(Key name: CFBundlePackageType)

The type of the (bundle) used to identify the entire package. In Mac, a package may be a file or directory,

Its purpose is to package together the resources used by the software. For example an application should be identified as APPL.

 

10. Bundle version

(Key name: CFBundleVersion)

Used to identify the build version (Bundle number), you can use any string format to represent this version.

For example, use a number to represent the number of compilations.

 

11. Bundle version string,short

(B 名 : CFBundleShortVersionString)

The version of the application, usually a three-digit version number, for example: 1.0.1.

 

12. Executable architectures

(键名:LSExcutableArchitectures)

为一个阵列形态的设定值。用以设置硬件设备的架构环境,例如:i386,ppc,ppc64,x86_64

 

13. Executable file

(键名:CFBundleExecutable)

执行档的名称。

 

14. Fonts provide by application

(键名:UIAppFonts)

为一个阵列形态的设定值。用来指定应用程序所使用的外部字型。你可以在应用程序内使用自己的字型档,

只要将字型档案加入到专案内,在设定值指定字型档名称就可以在程式码裡面使用到这些字型了。

 

15. Get Info string

(键名:CFBundleGetInfoString)

用于Mac的Finder上的应用程序的描述。

 

16. Icon already includes gloss effects

(键名:UIPrerenderedIcon)

指定应用程序的图示是否加上光晕效果,如果不希望加上光晕效果,那麽勾选此选项。

 

17. Icon file

(键名:CFBundleIconFile)

用来设定应用程序的图示档,如果没有指定的话,则使用预设值Default.png,依照Apple的规定,

这个图是必须是57x57的图形档。

 

18. Icon files

(键名:CFBundleIconFiles)

由于iPhone与iPad的开发工具以及SDK都是相同的,因此同一个应用程序也可以同时在两个设备上使用,

只不过两著的图是不太一样。这个键值是一个阵列类型的设定值,用来指定iPhone与iPad的应用程序图示,

你只要给两个图片文件名,其中iPhone的图示为57x57 pixel,iPad则为72x72 pixel,

系统会自动依照图片大小判断该图片是使用在哪种设备上。

 

19. Info dictionary version

(键名:CFBundleInfoDictionaryVersion)

info.plist格式的版本。一般来说,我们不会变动这个数值。

 

20. Initial interface orientateon

(键名:UIInterfaceOrientation)

指定应用程序打开时的方向。

 

21. Laumch image

(键名:UILaunchImageFile)

用以指定应用程序启动时的图片文件。

 

22. Localization native development region

(键名:CFBundleDevelopmentRegion)

应用程序原始的语言版本。

 

23. Localizations

(键名:CFBundleLocalizations)

用以指定应用程序所支持的语言。

 

24. Localized resources can be mixed

(键名:CFBundleAllowedMimxedLocalizations)

是否允许应用程序可以取得框架库内的语言文件。

 

25. Main nib file base name

(键名:NSMainNibFile)

主要的Nib文件名称,预设值为MainWindow。

 

26. Renders with edge antialisasing

(键名:UIViewEdgeAntialiasing)

设定core animation的图层是否开启抗锯齿功能。

 

27. Renders with group opacity

(键名:UIViewGroupOpacity)

设定core animation的图层使否继承上一层透明度。

 

28. Required background modes

(键名:UIBackgroundModes)

设定当应用程序进入后台执行后,哪些动作要继续在背景执行。这个键值是一个阵列类型的设定,

可设定动作包括:audio,locateon,voip。

 

29. Required device capabilities

(键名:UIRequiredDeviceCapabilities)

设定应用程序需要使用到的硬件,如此可以确定应用程序在该设备上执行时不会发生错误。

 

30. Status bar is initially hidden

(键名:UIStatusBarHidden)

设定状态栏是否一开始隐藏。

 

31. Status bar style

(键名:UIStatusBarStyle)

设定状态栏的显示类型。

 

32. Supported external accessory protocols

(键名:UISupportedExternalAccessoryProtocols)

指定应用程序与外界硬件配件间支持的通讯协定,这个键值是一个阵列设定,可以指定多个通讯协定。

 

33. Supported interface orientateons

(键名:UISupportedInterfaceOrientations)

设定应用程序所支持的显示模式(肖像模式或风景模式),这个键值是一个阵列,可以支援多个不同的显示模式。

 

34. Supported interface orientateons

(键名:UIUpgradeOtherBundleIdentifier)

设定应用程序所支持的显示模式(肖像或是风景模式),这个键值可以支援多个不同的显示模式。

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324934846&siteId=291194637