安卓:在多语言资源如何重新使用字符串 [英] Android: How to re-use strings in multi-language resources

查看:100
本文介绍了安卓:在多语言资源如何重新使用字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一次让我为难,因为我的第一个Android项目。考虑具有多语言字符串资源恩为默认的:

This one puzzles me since my first android project. Consider multi-language string resources with 'en' as the default:

res/values/strings.xml     <--- The default language 'en'
res/values-de/strings.xml  <--- de
res/values-fr/strings.xml  <--- fr
res/values-it/strings.xml  <--- it

使用该文件夹结构,这个应用程序在Android Market条目显示在默认情况下,德国,法国和意大利唯一的语言支持。是的,英语是缺少在该列表中。

With that folder structure the Android Market entry for this app shows language support for "default, german, french and italian only". Yes, english is missing in that list.

是否有可能包括完整的默认字符串从值文件夹中的一个额外的值恩文件夹中的资源。是的,我不希望保持在这个新文件夹中的文件,因为一切都已经在默认的字符串资源声明。

Is it possible to "include" the complete default strings resource from the "values" folder in an additional "values-en" folder. And yes, I don't want to maintain that file in that new folder because everything is declared in the default string resource already.

在预先感谢。

哈拉尔

推荐答案

我不太明白问题出在哪里。只要创建一个值恩目录和copy'n粘贴您的默认目录的XMLS到新的。

I don't quite understand where the problem is. Just create a values-en directory and copy'n paste the XMLs from your default directory to the new one.

如果你只是想有一种到默认值目录的符号链接,这样,当你想改变什么的默认目录下的文件,我的链接目录重新present同样的变化,那么你只要到文件 - &GT;新 - &GT;文件夹选择其中新文件夹应创建(在你的情况下, RES 目录),然后打在高级&GT; &GT; 并有选择链接到备用位置(链接的文件夹)再浏览到你想链接到(在你的情况下,目录中的目录)和你做。

If you just want to have a kind of symbolic link to that default values directory so that when you change something inside the default directory the files i the linked directory represent the same changes then you just go to File -> New -> Folder select where the new folder should be created (in your case the res directory) and then hit on Advanced >> and there select Link to alternate location (Linked Folder) then browse to the directory you want to link to (in your case the values directory) and your done.

现在,只要你改变一些东西在目录下的所有的更改应用到新的链接目录。

Now whenever you change something inside the values directory all your changes apply to the new linked directory.

这篇关于安卓:在多语言资源如何重新使用字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆