Issue
I was wondering if it's possible to load resources from strings.xml in raw xml resource. Example:
<root>
<element>@string/res1</element>
<element>@string/res2</element>
<element>@string/res3</element>
</root>
Is this possible?
If it's not possible, if I create a raw xml resource, do I have to provide multiple files for localization purposes?
Solution
Are you trying to use values declared in strings.xml
in a file inside /raw/
? Then no, that's not possible. If you want to internationalize your "raw" XMLs you can provide one for each of your supported languages in the appropriate folder (/raw-fr/
, /raw-en/
, etc). At least that's out of the box.
Alternatively, you can establish a template format and parse the raw XMLs in Java and fetch the appropriate string resource from there instead.
Answered By - dmon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.