localization - Setting region based Local in android -
I want to specify different values for Arabic language in different areas.
I have the following values folders in the reserve directory:
res / values res / vaues-ar res / values-ar-rsa Depending on the selected area, I am trying to set up local like this:
locale locale = new locale ("AR-SA"); Locale.setDefault (location); Configuration config = new configuration (); Config.locale = locale; GetBaseContext (). GetResources () Update Configuration (config, getBaseContext). GetResources () GetDisplayMetrics ()); But it always loads values from the res / values-ar folder.
Okay I thought it. To set up a field based locale, I need to use a different constructor. Just changed this line
locale locale = new locale ("AR-SA"); this
locale locale = new locale ("AR", "SA"); // (language, country)
Comments
Post a Comment