strolch-wc-localize-behavior/strolch-wc-localize-behavio...

24 lines
871 B
HTML
Raw Normal View History

<link rel="import" href="../app-localize-behavior/app-localize-behavior.html">
<script>
// custom behaviour accessing the configuration above
StrolchLocalizeBehaviorImpl = {
attached: function () {
2017-09-12 15:11:05 +02:00
var locale = Strolch.getUserLocale();
//console.log("Initializing for '" + this.localName + "' for locale " + locale + " and path " + this.localesPath);
// load the language resource of the configured language
2017-09-12 15:11:05 +02:00
this.language = locale;
2017-03-08 16:34:42 +01:00
this.useKeyIfMissing = true;
if (Strolch.isNotEmptyString(this.localesPath)) {
this.loadResources(this.resolveUrl(this.localesPath));
}
}
};
// inherit the behavior of the standard polymer localization
StrolchLocalizeBehavior = [Polymer.AppLocalizeBehavior, StrolchLocalizeBehaviorImpl];
</script>