简体   繁体   English

在国际上部署android应用程序

[英]Deploying an android application internationally

Hello there fellow Android developers. 您好,Android开发人员。 I am looking for some feedback. 我正在寻找反馈。 I am about to do a major international deployment of an android application. 我即将对android应用程序进行大规模的国际部署。 Something I need to worry about is language settings. 我需要担心的是语言设置。 What I have done right now is used the default language setting specific /res/values- setting where you have multiple folders called values-en, values-es, values-pt, things like that. 我现在所做的是使用默认语言设置特定的/ res / values-设置,其中有多个文件夹,分别称为values-en,values-es,values-pt等。 So what I am wondering the following. 所以我想知道以下内容。

When my android default strings.xml is in English, will the way I am handling language be sufficient. 当我的android默认string.xml是英语时,我处理语言的方式就足够了。 It works here in development and probably deployed from the US store. 它在开发中可以在这里工作,并且可能从美国商店部署。 But when deployed from other stores will the device think, I am from the Spanish store so the default strings.xml file should be in Spanish, or will it know, I am Spanish store so I will use values-es? 但是,当从其他商店部署时,设备会认为,我来自西班牙商店,因此默认的strings.xml文件应使用西班牙语,或者会知道,我是西班牙商店,所以我将使用values-es?

Anyways I would like feedback from someone who has deployed like this before please. 无论如何,我希望得到之前已经部署过这样的人的反馈。 It seems to be a question that is pretty guessable, however I am wanting to confirm with other developers what their experiences have been. 这似乎是一个很容易猜测的问题,但是我想与其他开发人员确认他们的经历。

Thanks, Anthony 谢谢安东尼

The language folder that is used is based on the user's selected language , not anything relating to where they are. 使用的语言文件夹基于用户选择的语言 ,而不与用户所处的位置有关。 You can test what each language looks like in your app by changing your device to a different language. 您可以通过将设备更改为其他语言来测试每种语言在应用中的外观。

From my experience, the selected language resource is based on the selected language on device, so no matter which store your app is downloaded from, if the device language setting is english, values-en will be selected. 根据我的经验,所选语言资源基于设备上的所选语言,因此,无论从哪个商店下载应用程序,如果设备语言设置为英语,都将选择values-en

But you don't need to worry about it, as long as you have i18n files for all language you want your application to be translated to, the device will do the rest of the work for you. 但是,您不必担心,只要您拥有要翻译应用程序的所有语言的i18n文件,设备就会为您完成其余的工作。

If your read this page, it stated : 如果您阅读页面,则说明:

To add support for more languages, create additional values directories inside res/ that include a hyphen and the ISO country code at the end of the directory name. 要增加对更多语言的支持,请在res /中创建其他值目录,在目录名称的末尾包含连字符和ISO国家/地区代码。 For example, values-es/ is the directory containing simple resourcess for the Locales with the language code "es". 例如,values-es /是包含语言代码“ es”的语言环境的简单资源的目录。 Android loads the appropriate resources according to the locale settings of the device at run time . Android在运行时根据设备的语言环境设置加载适当的资源

Add the string values for each locale into the appropriate file. 将每个语言环境的字符串值添加到适当的文件中。

At runtime, the Android system uses the appropriate set of string resources based on the locale currently set for the user's device. 在运行时,Android系统根据当前为用户设备设置的语言环境使用适当的字符串资源集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM