Yandex MapKit set locale of labels

680 Views Asked by At

How can I set the label locale in mapkit?

MapKit dont use default localization for text marks

 mapView.getMap()

does not contain suitable methods

1

There are 1 best solutions below

0
On BEST ANSWER

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.