可能重复:
How can I create a multilingual android application?
我正在创建应用程序,我正处于测试阶段,但我想使我的应用程序多语种。
我怎样才能使它多语种?做这件事最好的方法是什么?
发布于 2012-01-16 16:25:56
您需要做的是在res文件夹中创建新的文件夹。
示例:如果您需要添加对西班牙语和意大利语的支持,您需要这样做:
1.1数值
1.2数值-es //西班牙文
1.3值-it //意大利语
之后,您需要在string.xml和values-es中创建values-it文件。在所有文件中,只需创建要使用的所有字符串,如下所示:
<string name="title">Title</string> // in values folder
<string name="title">Title in Spanish</string> // in values-es folder
and etc.之后,您可以将这些字符串用作:
TextView text = (TextView) findViewById(R.id.textView);
text.setText(getString(R.string.title));这个应该能行的。
发布于 2012-01-16 16:09:00
看看关于本地化应用程序的本教程:http://developer.android.com/resources/tutorials/localization/index.html。
也许能帮上忙。
发布于 2012-01-16 16:12:54
有许多例子可以帮助您在android中创建多语言应用程序。
看一看这些文章:
http://developer.android.com/resources/tutorials/localization/index.html
http://www.icanlocalize.com/site/tutorials/android-application-localization-tutorial/
这将帮助您在android中创建多语言应用程序。
https://stackoverflow.com/questions/8882713
复制相似问题