Hi all,
I am currently implementing a mobile app and need assistance with two functionalities:
1. Finding the device's preferred language.
2. Retrieving the device's Selected country.
Could anyone provide guidance or point me to relevant resources/documentation for achieving these tasks in OutSystems?
Thank you!
Best regards,
Sai.
Hi,
To get the currentLocale (language) use the following action, which is not only available as server action but for your case also as client action:
https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/built_in_functions/environment/#GetCurrentLocale
To get the country where the device is you first need to get the GeoLocation, you can do that with the following plugin:
https://www.outsystems.com/forge/component-overview/1395/location-plugin-o11
After that you need to do some reverse geocoding with the latitude and longtitude values to derive the country in which the device is located.
r that do reverse geocoding that will provide you the location address.Here is the google documentation link how to do reverse geocoding with the latitude and longitude values https://developers.google.com/maps/documentation/geocoding/start?csw=1#ReverseGeocoding
-- Daniel
Hi @Daniël Kuhlmann ,
Thanks for the response.
We have a solution for the language issue, but for the country, we need the selected country from the device, not from the latitude and longitude.
To retrieve the device's selected country, which is generally tied to the device's locale settings, you need to access the device's locale information. While OutSystems doesn't offer a built-in plugin for fetching locale settings directly, you can accomplish this by integrating a Cordova plugin that retrieves the device's locale settings.