Languages

Menu
Sites
Language
Reload index.html on device change language ?

How can i relaod the index.html on the devcie change language ?

Responses

2 Replies
Alex Dem

Hi,
I did not face with such event/notification, maybe you need restart your app, but after language was changed the value of window.navigator.language is changed dynamically in launched web app.
Alexey.

AVSukhov

Hello,

I kind of already answered this question.

If you using Tizen SystemInfo API yo listening LOCALE properety change (addPropertyValueChangeListener() method) in callback function you need implement I10n procedure to translate your content.

You may use third-party library, f.e.:

http://i18next.com/

http://keith-wood.name/localisation.html

https://github.com/eligrey/l10n.js/#readme

http://eligrey.com/blog/post/passive-localization-in-javascript/

Or you can implement translation ourselves (f.e. for all html elements, which must be translated, add some class "tr". In callback of addPropertyValueChangeListener loads appropriate json or js file with translations. After this change innerHTML for all elements with class "tr" - but it is not the best way)

This is Content-based localization. This method does not require reloading the page.

Another way - Folder-based localization.

This way requires page reloading, and the localized contents will only be reflected at next launching time.

But as i known, you cannot reload page programmatic.