2017-02-20 12:57:39 +01:00
|
|
|
<link rel="import" href="../app-localize-behavior/app-localize-behavior.html">
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
// custom behaviour accessing the configuration above
|
|
|
|
StrolchLocalizeBehaviorImpl = {
|
2017-09-13 15:51:12 +02:00
|
|
|
attached: function () {
|
2017-09-12 15:11:05 +02:00
|
|
|
var locale = Strolch.getUserLocale();
|
2020-05-11 16:12:48 +02:00
|
|
|
//console.log("Initializing for '" + this.localName + "' for locale " + locale + " and path " + this.localesPath);
|
2017-02-20 12:57:39 +01:00
|
|
|
|
|
|
|
// 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;
|
2017-09-13 15:51:12 +02:00
|
|
|
|
|
|
|
if (Strolch.isNotEmptyString(this.localesPath)) {
|
|
|
|
this.loadResources(this.resolveUrl(this.localesPath));
|
|
|
|
}
|
2017-02-20 12:57:39 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// inherit the behavior of the standard polymer localization
|
|
|
|
StrolchLocalizeBehavior = [Polymer.AppLocalizeBehavior, StrolchLocalizeBehaviorImpl];
|
2017-03-08 16:31:27 +01:00
|
|
|
</script>
|