Reputation: 4286
I want to serve local language content in my app. I am reading a .txt file in res/raw folder using FileReader (Buffered one). I have read that Android can automatically translate text for values/strings.xml file.
Is the same possible for raw text files. I am looking for minimal code changes.
Upvotes: 12
Views: 5894
Reputation: 82553
Android does not automatically translate any files.
You as a developer can translate them and put the resources in appropriately qualified folders, like values-en
, values-fr
and so on.
These qualifiers work on all folders under res
, including the raw
folder.
No code changes are required, as Android will automatically pick the correct file upon runtime. However, you should always keep a copy in the default folder with no qualifications in case the app is run on a device for which you do not have content available.
Upvotes: 29