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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With