1

Some places on the map is labeled with Cyrillic names, but I need only English/Latin names of places on the map, however sometimes there are only local names. In general I need transliteration to English? How can I implement this?

P.S.: I have spotted this issue on Belorussian and partly on Russian places.enter image description here

1

After all, it depends on which languages specific placename is tagged in OpenStreetMap there is always "local" variant in local primary language, and CARTO Mobile SDK uses this, but the data has also other languages, so you can control it as following.

CartoVectorTileLayer (both CartoOnlineVectorTileLayer and CartoOfflineVectorTileLayer are subclasses of it) has method setLanguage(String) to select language, so e.g.:

layer.setLanguage("en");

will give you English language maps.

In SDK 4.0.2 SDK and nutiteq.osm tile source you can use following languages: local/default (will give Казахстан in your case), en, es, de, fr, it, ru, zh (Chinese), tr (Turkish) and et (Estonian) as language

From newer CARTO SDK 4.1.0 and new carto.streets source you can use any OSM language. I would suggest to configure map based on device language settings, with something like:

// Android
layer.setLanguage(Locale.getDefault().getLanguage());

// iOs / Xamarin
layer.Language = Foundation.NSLocale.PreferredLanguages[0].Substring(0, 2);

What if specific name is not available in given language? Then the MapView will fallback to 'local' language by default, the map will not be empty. But if the 'local' language is still unreadable, so I'd prefer latin alphabet names? In SDK 4.1.0 you can configure primary and secondary fallback languages, e.g. you set primary language to 'de' for Germans, then to avoid strange alphabets (say Hebrew, Greek, most of Asia) set 'en' as primary fallback; then local is used only if both your primary and English names are missing:

layer.FallbackLanguage = "en";
  • Thanks, the last paragraph seems exactly what I need. However I can't figure out how to set fallback language... (I'm developing with XAMARIN Android and iOS). I found Language property of layer, but can't find fallback language property – Oleg Kosuakiv Nov 6 '17 at 12:25
  • Seems I should have just update NuGET package to version 4.1.0. – Oleg Kosuakiv Nov 6 '17 at 13:03
  • With latest version there is layer.FallbackLanguage = "en"; – JaakL Nov 6 '17 at 14:07
  • Yes, it is. But I need not exactly fallback language. Do I have any possibility to organize transliteration to English? – Oleg Kosuakiv Nov 6 '17 at 14:09
  • No, currently I don't imagine how automatic transliteration would work. It may require custom function even, as there are several Romanization alternatives for Russian. Quote from wikipedia: "There are a number of incompatible standards for the Romanization of Russian Cyrillic, with none of them having received much popularity and in reality transliteration is often carried out without any uniform standards". But yes, the SDK does not support any of them. – JaakL Nov 6 '17 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.