[Minor] Don't load resources if no localesPath

This commit is contained in:
Robert von Burg 2017-09-13 15:51:12 +02:00
parent 11e31089a3
commit facb519870
2 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{
"name": "strolch-wc-localize-behavior",
"description": "Strolch Polymer Localization Behavior extension",
"version": "1.1.0",
"version": "1.1.1",
"authors": [
"Franz Nieschalk",
"Robert von Burg"

View File

@ -4,14 +4,16 @@
// custom behaviour accessing the configuration above
StrolchLocalizeBehaviorImpl = {
attached: function() {
attached: function () {
var locale = Strolch.getUserLocale();
// load the language resource of the configured language
this.language = locale;
this.useKeyIfMissing = true;
console.log('Loading locales ' + this.localesPath);
this.loadResources(this.resolveUrl(this.localesPath));
if (Strolch.isNotEmptyString(this.localesPath)) {
this.loadResources(this.resolveUrl(this.localesPath));
}
}
};