ios info.plist 中的“本地化原生开发区域”条目是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5005236/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 18:53:43  来源:igfitidea点击:

What is the meaning of "Localization native development region" entry in info.plist?

iosinfo.plist

提问by Sefran2

I don't know if I really understood the function of the "Localization native development region" entry in info.plist file.

不知道我是不是真的理解info.plist文件中“本地化原生开发区”条目的作用。

Somewhere I read that this entry allows to specify the app language when there is no matching with a language resource dir.

我在某处读到此条目允许在与语言资源目录不匹配时指定应用程序语言。

I have an app localized in three languages: english, italian and spanish (en.lproj, it.lproj and es.lproj) and I set "Localization native development region" entry to Italy. When I change the language and locale in "Settings" (for example by chosing the arabic language and a proper region), the app language is english. Shouldn't be it italian as I set "Localization native development region" to Italy in the info.plist?

我有一个以三种语言本地化的应用程序:英语、意大利语和西班牙语(en.lproj、it.lproj 和 es.lproj),我将“本地化本地开发区域”条目设置为意大利。当我在“设置”中更改语言和区域设置时(例如通过选择阿拉伯语和适当的区域),应用程序语言为英语。当我在 info.plist 中将“本地化本地开发区域”设置为意大利时,不应该是意大利语吗?

Any ideas? Could it be tied to the AppStore app description language?

有任何想法吗?它可能与 AppStore 应用描述语言有关吗?

采纳答案by serpah

From the CFBundle documentation:

从 CFBundle 文档:

kCFBundleDevelopmentRegionKey The name of the development language of the bundle. When CFBundle looks for resources, the fallback is to look in the lproj whose name is given by the kCFBundleDevelopmentRegionKey in the Info.plist file. You must, therefore, ensure that a bundle contains an lproj with that exact name containing a copy of every localized resource, otherwise CFBundle cannot guarantee the fallback mechanism will work. Available in iOS 2.0 and later. Declared in CFBundle.h.

kCFBundleDevelopmentRegionKey 包的开发语言名称。当 CFBundle 查找资源时,回退是查找 lproj,其名称由 Info.plist 文件中的 kCFBundleDevelopmentRegionKey 指定。因此,您必须确保 bundle 包含一个具有该确切名称的 lproj,其中包含每个本地化资源的副本,否则 CFBundle 无法保证回退机制会起作用。在 iOS 2.0 及更高版本中可用。在 CFBundle.h 中声明。

No relation to the AppStore Description language.

与 AppStore 描述语言无关。

回答by Cleyton T.

I resolved using the settings below.

我使用下面的设置解决了。

Settings

设置

回答by Kim André Sand

The native development region also sets the default language spoken by VoiceOver. If you set this correctly you won't have to override the accessibility language in all the default components used in your app (which fall back to English).

本机开发区域还设置 VoiceOver 所说的默认语言。如果您正确设置了此项,您将不必覆盖应用程序中使用的所有默认组件(回退到英语)中的辅助功能语言。