Posted 14 September 2017, 3:07 am EST
Hi,
Sorry for not replying sooner. Still the same problem with code. Image below…
Also I see that you use some kind of JQuery for loading vendors, and you have local variable i18n, hmmmm very confusing answer.
import * as wjCore from “wijmo/wijmo”;
export class Globalization {
protected _culture: string;
i18n: any;
constructor() {
this._culture = "en";
this._loadCultureInfo();
}
get culture(): string {
return this._culture;
}
set culture(value: string) {
if (this._culture != value) {
this._culture = value;
this._loadCultureInfo();
}
}
protected _loadCultureInfo() {
var self = this;
$.ajax({
url: 'scripts/vendor/wijmo.culture.' + self.culture + '.js',
dataType: 'script',
success: function (data) {
// culture applied, now load translations
$.ajax({
url: 'translations/strings.' + self.culture + '.js',
dataType: 'json',
async: false,
success: function (data) {
console.log(JSON.stringify(data));
self.i18n = data;
// update controls to reflect changes
wjCore.Control.invalidateAll();
}
});
},
});
}
}
In angular 2 - Internationalization is mark with (i18n), and you use this in HTML elements to mark the words necessary for translation. There is no need for local variable. Why do you need this local variable i18n? Maybe my main question is: If I load vendors and translation, is this enough for Wijmo controls to change language nad globalization or not?
Best regards,
M