0

I have placed the resources to support different languages in appropriate packages as suggested in Android Localization documentation. Is there a way to add additional languages, i.e, resources after the app is installed without having to download and re-install the app. I mean updating the app - adding new resources and even updating some existing ones.

For example if my app initially supported English and French. Now suppose I want to add new language say Hindi and update few of the resources in English. So what is the approach..?

Xavier DSouza
  • 2,861
  • 7
  • 29
  • 40
  • you have to place the appropriate language resources inside the resources folder. – Shriram Mar 21 '14 at 12:15
  • Add a values-hi folder in the res path and a strings.xml file with the Hindi resources in it. look at the [reference page](http://developer.android.com/guide/topics/resources/localization.html). You might also want to use a Hindi-specific font, as stated [here](http://stackoverflow.com/a/8603015/2649012) – Phantômaxx Mar 21 '14 at 12:15
  • How can I add appropriate packages(values-hi) and files(strings.xml) within them after app is installed? – Xavier DSouza Mar 21 '14 at 12:18
  • No... you have to reinstall the app. Share an update to your users. ChangeLog: "Added Hindi language" – Phantômaxx Mar 21 '14 at 12:19
  • In my question I have clearly mentioned without having to re-install..You are suggesting me the same thing. I have already added languages as given in the documentation. – Xavier DSouza Mar 21 '14 at 12:21
  • @Vyger So you say it is not possible to add languages or resources once the app is installed. Only way is to re-install the updated app(.apk) with new language support & updated resources. – Xavier DSouza Mar 21 '14 at 12:26
  • Yes. OR your app is always connected to an online db that can serve your strings in different languages - but this would be an **overkill**, and really wouldn't be worth the effort! – Phantômaxx Mar 21 '14 at 12:31
  • Well... I strongly discourage you doing it that way. The upgrade is a much better approach. – Phantômaxx Mar 21 '14 at 12:34

1 Answers1

0

I had this issue, my approach is to create separate folder on the device \data\packageName\languages\ there will be one file called supportedfiles.lang the format of the file will be English en Russian ru ... also in same location you will have the following files en.lang ru.lang

the format of each language file ie(en.lang / ru.lang) will be like regular strings.xml Some text

when you load the application in settings screen you will read the supportedfiles.lang and show to user the supported languages when he choose different language you just need to load the appropriate language file

Maybe it is over kill, but you will have the flexibility to support other languages while the application installed without updating the application just copy the files into /data/package/languages/

visionix visionix
  • 780
  • 1
  • 8
  • 18