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

24 lines
871 B
HTML

<link rel="import" href="../app-localize-behavior/app-localize-behavior.html">
<script>
// custom behaviour accessing the configuration above
StrolchLocalizeBehaviorImpl = {
attached: function () {
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
this.language = locale;
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>