Dojo localization with cookie

193
0
08-26-2020 05:35 PM
KiroAndreev1
New Contributor II

Dear,

I have widget(with name Languages) which have two links for changed languages. The code in widget.js is:

enClicked: function () {
if (this.dojoConfig)
this.dojoConfig.locale = "en";
dojoConfig.locale = "en";
cookie('wab_app_locale', "en");
window.location.reload();
},
mkClicked: function () {
if (this.dojoConfig)
this.dojoConfig.locale = "mk";
dojoConfig.locale = "mk";
cookie('wab_app_locale', "mk");
window.location.reload();
},

enClicked is event for changed to English and  mkClicked is Event to changed to Macedonian language. 

I would like to change language in another widget with name LogIn:

In nls folder(of LogIn widget) i have one string.js which is default is on english language.In this string.js have next code:

define({
root: {
labels: {
username: 'User name',
password: 'Password',
login: 'Login',
cancel: 'Cancel',
loginFailed: 'LoginFailed!',
loginSuccess: 'LoginSuccess!',
NewPassword: 'NewPassword',
OldPassword: 'OldPassword',
LoggedAs: 'LoggedAs: ',
LogOut: 'LogOut',
ChangePass: 'ChangePass',
ConfirmPass: 'ConfirmPass',
logIn: 'LogIn',
loggedUsr: 'LoggedUsr',
chngPass: 'ChngPass'

}
},
  "mk": true
});

Into nls folder(of LogIn widget) i have another folder with name mk which have also string.js file with code:

define({
labels:
{
username: 'Корисничко име',
password: 'Лозинка',
login: 'Најави се',
cancel: 'Откажи',
loginFailed: 'Неуспешна најава!',
loginSuccess: 'Успешно се најавивте!',
NewPassword: 'Нова Лозинка',
OldPassword: 'Стара Лозинка',
LoggedAs: 'Логирани сте како: ',
LogOut: 'Одјави се',
ChangePass: 'Промени лозинка',
ConfirmPass: 'Потврди лозинка',
logIn: 'Најава',
loggedUsr: 'Логиран Корисник',
chngPass: 'Промена на лозинка'

}
});

When i click on button mk of widget Languages the application is reload but language is same(in English language is not changed) in widget LogIn.

How to solved this problem, to change language from English to Macedonian and back.

Best regard

0 Kudos
0 Replies