开发者

Android: How to re-use strings in multi-language resources

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

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 b开发者_开发技巧ecause everything is declared in the default string resource already.

Many thanks in advance.

Harald


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.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜