0

I am stuck on a problem. I have an android app that supports 2 languages - English and Bangla.

I have 3 spinners namely stateSpinner, districtSpinner, and subdivisionSpinner. The localization is working fine.

The problem I have is storing the name of the State, District, and Subdivision in English (strings.xml).

Is there any way to read the data from strings.xml (English) only?

Mohsen Bg
  • 143
  • 2
  • 6
TechBee
  • 1,897
  • 4
  • 22
  • 46
  • Android will pull from `strings.xml` unless there's a version of that string in a more specific locale. So you'd put your "default" version of those strings in `strings.xml`, and then the variant you need (English or Bangla) in the appropriate localised version of `strings.xml`. If you don't need a variant (e.g. addresses in English only) then you only need your "default" version in `strings.xml`. It's the same as any localisation really - or are you trying to do something more specific? (Like having both versions, but temporarily switching to English addresses when the user is using Bangla) – cactustictacs Aug 28 '22 at 18:05
  • @cactustictacs Temporarily switching to English addresses when the user is using Bangla. This is the case. – TechBee Aug 29 '22 at 01:13
  • 1
    Have a look at this answer (it also mentions an issue you need to handle with App Bundles, where unused languages are stripped out by default): https://stackoverflow.com/a/9475663/13598222 – cactustictacs Aug 29 '22 at 02:29

0 Answers0