语言

Menu
Sites
Language
Change Device Laocale ??

I want to change the layout once the user change the device LOCALE ?

I used addPropertyValueChangeListener how can relaunch the app with the new localization ??

响应

2 回复
AVSukhov

Hello,

About Localization:

Localization:

Folder-based localization 

    • Web App contents can be localized in file unit according to W3C Widget P&C specification

    • The localization requires page reloading, and the localized contents will only be reflected at next launching time

Element-based localization

    • Configuration document can be localized with xml:lang attribute

Content-based localization

    • System locale change event can be listened with Tizen System Info API

    • L10n routine needs to be implemented in locale change event handler

 

If you using Folder-based localization described in dev guide:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.mobile.web.appprogramming/html/app_dev_process/localize_widget.htm

or

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.wearable.web.appprogramming/html/app_dev_process/localize_widget.htm

your changes will be avaliable only after page reloading.

 

If you using Content-based localization you need implement L10n or i18n algorithm to translate content itself. You can use third-party library.

There is guide using Globolize lib:

https://developer.tizen.org/documentation/articles/localization?langredirect=1

Also this topic can helps you:

http://stackoverflow.com/questions/14358817/best-practice-for-localization-and-globalization-of-strings-and-labels

Who knows how to disable app restart when localization is changed?

No matter whether the methods are used:

- tizen.systeminfo.getPropertyValue("LOCALE", ---);

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