java - 在国际范围内部署 Android 应用程序

标签 java android deployment locale

各位 Android 开发者大家好。我正在寻找一些反馈。我即将对 Android 应用程序进行一次重大的国际部署。我需要担心的是语言设置。我现在所做的是使用默认语言设置特定的/res/values- 设置,其中有多个名为 value-en、values-es、values-pt 等的文件夹。所以我想知道以下内容。

当我的 android 默认 strings.xml 是英语时,我处理语言的方式是否足够。它正在开发中,并且可能是从美国商店部署的。但是,当从其他商店部署时,设备会认为,我来自西类牙商店,因此默认的 strings.xml 文件应该是西类牙语,或者它会知道,我是西类牙商店,所以我将使用 value-es?

无论如何,我希望得到之前已经进行过此类部署的人的反馈。这似乎是一个很容易猜测的问题,但我想与其他开发者确认他们的经历。

谢谢, 安东尼

最佳答案

如果您阅读 this页面,它指出:

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. For example, values-es/ is the directory containing simple resourcess for the Locales with the language code "es". Android loads the appropriate resources according to the locale settings of the device at run time.

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.

关于java - 在国际范围内部署 Android 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19038789/

相关文章:

java - 控制java中的循环执行速度 - Android

android - 让 ArrayAdapter 带有对象列表,以在 ListView 中显示包含字符串的对象

deployment - Azure部署错误: cannot find ClientPerfCountersInstaller. exe

deployment - 使用 Wix 进行有条件安装

Azure DevOps 部署概述

java - Android 按钮带有透明文本

java - Jackson 接口(interface)序列化

java - JSON.simple 库显示意外字符 (<)

Android:尝试启动 OpenGL Activity ,应用程序崩溃

java - 如何获取 JUnit 5 中测试的当前重复次数?