I have App of two pages. I was able to translate the first page to Chinese and German by choosing the langauge from selectMenu. I added a second page to the App but I could not apply the translation. In the first page, the following script run on selectMenu value chage:
var val = Appery("typeList").val();
var option = {lng: val, resGetPath: 'locales/lng/ns.json', fallbackLng: 'en-US'};//Pass the initialization language,
$.i18n.init(option, function(t) {
$(document).i18n(); //Once the translations are loaded translate the whole document
});
On the second page the following scritp run on page load event:
$(document).i18n();
However, when I navigate from first page to the second page, the language of the second page remains same (English) although the first page langauage is German. What I noticed is that if I change the values of the second page components to be identical to those in first page, the translation occurs. For example, There is lable1 in first page, the value in (more properties) options is (data-it18n : This is a Demo). If label2 in the second page has the same value, it will translate. If has different value (e.g. (data-i18n : This is a second Demo)) it will not be translated. Although I have both texts in json files (This is a Demo & This is a second Demo). The same applies to the Caption/header.