Android Question How to change the language of GoogleMaps

Ohanian

Active Member
Licensed User
Longtime User
Hi,

I’m trying to change the language of Google map, I’ve tried to change the Locale but it has not effect on the map.

Here’s a topic on stackoverflow :

B4X:
http://stackoverflow.com/questions/22863288/how-to-change-language-google-map-v2-android

I’m using this code :

Changing Locale of Android

B4X:
  Dim DeviceLocale AsLocale

  Log(DeviceLocale.GetDefault)

  ApplicationResources.SetDefaultLocale(DeviceLocale.CHINA)

  ApplicationResources.Initialize(ApplicationResources.RESOURCE_SOURCE_APPLICATION)

  Log(DeviceLocale.GetDefault)

  ApplicationResources.SetDefaultLocale(DeviceLocale.CHINESE)

  ApplicationResources.Initialize(ApplicationResources.RESOURCE_SOURCE_APPLICATION)

  Log(DeviceLocale.GetDefault)

Log !!! :

B4X:
(Locale) en_US
(Locale) en_US
(Locale) en_US

2nd and 3rd log should be CHINESE not English!

any suggestion?
 

Ohanian

Active Member
Licensed User
Longtime User
How to set the locale to Farsi (Persian) ?

I've tried these values but got the error message.

FARSI
PERSIAN
IRAN
fa_IR
ARABIC

B4X:
java.lang.RuntimeException: Field: ARABIC not found in: java.util.Locale

found it :
B4X:
    Dim DeviceLocale As Locale
    DeviceLocale.Initialize2("fa", "IR")

    Dim jo As JavaObject
    jo.InitializeStatic("java.util.Locale").RunMethod("setDefault", Array(DeviceLocale))
 
Last edited:
Upvote 0
Top