Name in different language

Hi,

Is there a way, using FNC Map, to get the name of the same place in different languages?

For example, search for the names of ANTWERP in different languages
French : Anvers
England : Antwerp
Dutch : Antwerpen
Spanish : Amberes
etc

Regards

olivier

Hi,

To change the names of places on the maps you can use

TMSFNCMaps1.Options.Local := 'fr-FR'; (names are in french)

Here is the list of supported languages:

If you want to use another component such as TTMSFNCGeoLocation or TTMSFNCDirections, there is an ALocale parameter that offers the same functionality, as well, which you can use the search for a place and convert to coordinates using a specific language tag.

Hi Pieter

Thanks for your answer, but my question was incorrect, Sorry :frowning:

In fact, with TMSFNCGeocoding component, I try to obtain the name of a localisation in different language.
I am using as service Here (gsHere).

Today, I succeed :)
However, I obtain a "curious" result with english

This is the code send and the result (Edit2Text = 'Anvers, Belgique' :innocent:) :
TMSFNCGeocoding1.GetGeocoding(Edit2.Text, nil, 'fr-FR', nil, 'fr-FR', mlmLanguage);
ResultString =

{"items":[{"title":"Anvers, Flandre, Belgique","id":"here:cm:namedplace:20204382","resultType":"locality","localityType":"city","address":{"label":"Anvers, Flandre, Belgique","countryCode":"BEL","countryName":"Belgique","stateCode":"VLG","state":"Flandre","county":"Anvers","city":"Anvers","postalCode":"2000"},"position":{"lat":51.22212,"lng":4.39769},"mapView":{"west":4.21795,"south":51.14343,"east":4.49824,"north":51.3777},"scoring":{"queryScore":1.0,"fieldScore":{"city":1.0}}}]}

TMSFNCGeocoding1.GetGeocoding(Edit2.Text, nil, 'es-ES', nil, 'es-ES', mlmLanguage);
ResultString =

{"items":[{"title":"Amberes, Flandes, Bélgica","id":"here:cm:namedplace:20204382","resultType":"locality","localityType":"city","address":{"label":"Amberes, Flandes, Bélgica","countryCode":"BEL","countryName":"Bélgica","stateCode":"VLG","state":"Flandes","county":"Amberes","city":"Amberes","postalCode":"2000"},"position":{"lat":51.22212,"lng":4.39769},"mapView":{"west":4.21795,"south":51.14343,"east":4.49824,"north":51.3777},"scoring":{"queryScore":1.0,"fieldScore":{"city":1.0}}}]}

TMSFNCGeocoding1.GetGeocoding(Edit2.Text, nil, 'nl-NL', nil, 'nl-NL', mlmLanguage);
ResultString =

{"items":[{"title":"Antwerpen, Vlaanderen, België","id":"here:cm:namedplace:20204382","resultType":"locality","localityType":"city","address":{"label":"Antwerpen, Vlaanderen, België","countryCode":"BEL","countryName":"België","stateCode":"VLG","state":"Vlaanderen","county":"Antwerpen","city":"Antwerpen","postalCode":"2000"},"position":{"lat":51.22212,"lng":4.39769},"mapView":{"west":4.21795,"south":51.14343,"east":4.49824,"north":51.3777},"scoring":{"queryScore":1.0,"fieldScore":{"city":1.0}}}]}

As you can see, it is correct. But when I request in english, the result is wrong ..
TMSFNCGeocoding1.GetGeocoding(Edit2.Text, nil, 'en-GB', nil, 'en-GB', mlmLanguage);
ResultString =

{"items":[{"title":"Antwerpen, Vlaanderen, België","id":"here:cm:namedplace:20204382","resultType":"locality","localityType":"city","address":{"label":"Antwerpen, Vlaanderen, België","countryCode":"BEL","countryName":"België","stateCode":"VLG","state":"Vlaanderen","county":"Antwerpen","city":"Antwerpen","postalCode":"2000"},"position":{"lat":51.22212,"lng":4.39769},"mapView":{"west":4.21795,"south":51.14343,"east":4.49824,"north":51.3777},"scoring":{"queryScore":1.0,"fieldScore":{"city":1.0}}}]}

Is the language parameter 'en-GB' is false ? (the result is the same with 'en-US) ?

regards
olivier

Hi again

I have a subsidiary question.
Is it possible to know the language used for the result when the requested language is empty ?

TMSFNCGeocoding1.GetGeocoding(Edit2.Text, nil, 'Vide', nil, '', mlmLanguage);

olivier

Hi,

You need to use mlmDefault, which then uses "en-GB". When using mlmCountry, the request will only use "en", when using mlmLanguage, the request will only use "GB". In some services, the request only works with the country instead of country-language, which is the reason why we have added this parameter. So you can just use it as (leaving the last parameter as default)

TMSFNCGeocoding1.GetGeocoding(Edit2.Text, nil, 'en-GB', nil, 'en-GB');

According to the documentation:

In cases where the user does not specify a response language, HERE Geocoding and Search aims to reflect the preference of the local people: it returns results in the official country language. In the regions with the primary regional language different to the official country language, HERE Geocoding and Search prefers the regional one.

So the response language is actually tied to the country. Requesting a city "Anvers, Belgique" without specifying the response language will return "Antwerpen, België", in Dutch, because that's the native language from that region. We couldn't immediately find an API endpoint to request the language code based on the region.

Thanks for your answer and very clear explanation
regards
olivier

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.