androidlocaleyandex-mapkit

Yandex MapKit set locale of labels


How can I set the label locale in mapkit?

MapKit dont use default localization for text marks

 mapView.getMap()

does not contain suitable methods


Solution

  • Finally, i did it

    Docs: i18ManagerFactory

    @Override
    public void onStart() {
        super.onStart();
        mapView.onStart();
        MapKitFactory.getInstance().onStart();
        .....
        I18nManagerFactory.setLocale(Locale.getDefault().getLanguage(), new LocaleUpdateListener() {
            @Override
            public void onLocaleUpdated() {
                Log.d(TAG","onLocaleUpdated");
            }
    
            @Override
            public void onLocaleUpdateError(@NonNull Error error) {
                Log.d(TAG,"onLocaleUpdateError");
            }
        });
    }
    

    Note: Country and Language settings are determined by system preferences. And user needs to restart the application for the changes to take effect.