Languages

Menu
Sites
Language
What is the change language listener (localization)?

When a user changes languages on their phone the language on the Gear S3 is changed as well. What is the change language listener (localization)? 
Gear S3, Tizen 2.3.2

Edited by: Anonymous on 03 May, 2019
View Selected Answer

Responses

1 Replies
Mark as answer
Armaan-Ul- Islam

You can use Web SystemInfo API to achieve your desired functionality. Add a property Value change listener for the systeInfo property "LOCALE". Please check the API references for details implementation.

https://developer.tizen.org/development/api-references/web-application?redirect=https://developer.tizen.org/dev-guide/3.0.0/org.tizen.web.apireference/html/device_api/mobile/tizen/systeminfo.html#SystemInfoLocale

https://developer.tizen.org/development/api-references/web-application?redirect=https://developer.tizen.org/dev-guide/3.0.0/org.tizen.web.apireference/html/device_api/mobile/tizen/systeminfo.html#SystemInfo::addPropertyValueChangeListener

 

The code should be something similar like this:

function onSuccessCallback(locale)
{
   console.log("Current language: " + locale.language);
   console.log("Current country: " + locale.country);
}

tizen.systeminfo.addPropertyValueChangeListener("LOCALE", onSuccessCallback);