I am using google-play-service-lib
. How can I change language of google map i.e. show locations in korian language or Hindi Language.
Google Maps on the web: Click the menu in the top left, then click Language and select any language to set it. Google Maps app for Android: Tap your profile picture in the top right, tap Settings > Navigation settings > Voice selection > a language. To also adjust the text language go to Settings > App language.
In the Google Maps app, tap your avatar to the right of the search bar at the top of the app. Scroll down and select Settings. Scroll down and go to Navigation settings. Choose Voice selection.
Open the Google Maps app, on your Android phone or tablet, Now tap on your profile picture or initial Account Circle and then Settings. Then tap on Navigation settings and then on Voice. Choose a voice and language.
hope this easy solution for changing map language helps someone:
simply add call setUpMapLocale()
in your activity onCreate()
:
private fun setUpMapLocale() {
val languageToLoad = "iw_IL" // your desired language locale
val locale = Locale(languageToLoad)
Locale.setDefault(locale)
baseContext.resources.configuration.setLocale(locale)
}
so i just had to call setLocale()
on the existing configuration attached to baseContext
resources
You can change location for Google Maps that use the Google Map API V2 by using a Locale Object. The language needs to be supported on the device being used though.
Here is the full list of supported languages.
With this code below I was able to change the language on the map to Chinese:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String languageToLoad = "zh_CN";
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
setContentView(R.layout.activity_maps);
setUpMapIfNeeded();
}
Result, language set to Chinese in the code (no manual changes) on a U.S. based phone:
I was also able to get it to show Korean, use this Locale code:
String languageToLoad = "ko_KR";
Result:
NOTE
It looks like the supported languages for Google Maps are listed here: https://developers.google.com/maps/faq#languagesupport
We only need to change the location in the application to get the Map´s descriptions with different language. We have to add validations to avoid the use of deprecated methods:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
String language= "hi"; //Hindi language!.
Locale locale = new Locale(language);
Locale.setDefault(locale);
Configuration config = new Configuration();
if(Build.VERSION.SDK_INT>Build.VERSION_CODES.JELLY_BEAN){
config.setLocale(locale);
getContext().createConfigurationContext(config);
}else { //deprecated
config.locale = locale;
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
}
...
...
...
Very important to say that all the languages are not supported, this is an example in Russian language:
We can get the code languages from:
https://www.transifex.com/explore/languages/
Just change the locale on the device. If translations are available, they will be shown automatically.
A screenshot of my US phone with the locale switched to Korean:
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