If you specify the language query parameter in the request, then the names of e.g. places, countries, cities, streets... will be returned in that language, if it is available in the data. While country and city names are available in many languages, this is less true for street names.
The language parameter has to be formatted according to the BCP 47 language tag specification. Such a language tag starts with the ISO-639-1 language code optionally followed by a sub-tag for the script (ISO 15924, usually written in Title Case), the variant or other extensions. In the following example the desired language is set to English.
https://api.myptv.com/geocoding/v1/locations/by-text?searchText=Sandkaul&language=en
For cases where ISO 639-1 and these subtags are still not sufficient, the BCP 47 standard allows defining tags for private use.
The Geocoding API knows two private-use tags:
- x-ptv-DFT will return each result in a language most commonly used in that country or region. This is the default if there is no language specified.
- x-ptv-Latn-DFT will return each result in the latinised version of the language most commonly used in that country or region.
The following list shows examples of supported language tags:
Language | BCP 47 |
---|---|
Arabic | ar |
English that was transliterated from the original Arabic | en-Latn-t-ar |
Azerbaijani, Latin script | az-Latn |
Bulgarian | bg |
Catalan; Valencian | ca |
Chinese | zh |
Chinese, traditional script, in Macao | zh-Hant-MO |
Croatian | hr |
Czech | cs |
Danish | da |
Dutch; Flemish | nl |
English | en |
Finnish | fi |
French | fr |
Georgian | ka |
English that was transliterated from the original Greek | en-t-el |
Greek | el |
Hungarian | hu |
Icelandic | is |
Italian | it |
Japanese | ja |
Korean | ko |
Malay | ms |
Norwegian | no |
Polish | pl |
Portuguese | pt |
Russian | ru |
Romanian | ro |
Serbian | sr |
Slovenian | sl |
Slovak | sk |
Spanish | es |
Swedish | sv |
Thai | th |
Turkish | tr |
Ukrainian | uk |
Vietnamese | vi |