언어 설정

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 5월, 2019
답변 바로가기

Responses

1 댓글
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);