[Minor] Don't load resources if no localesPath
This commit is contained in:
parent
11e31089a3
commit
facb519870
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "strolch-wc-localize-behavior",
|
"name": "strolch-wc-localize-behavior",
|
||||||
"description": "Strolch Polymer Localization Behavior extension",
|
"description": "Strolch Polymer Localization Behavior extension",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Franz Nieschalk",
|
"Franz Nieschalk",
|
||||||
"Robert von Burg"
|
"Robert von Burg"
|
||||||
|
|
|
@ -4,14 +4,16 @@
|
||||||
|
|
||||||
// custom behaviour accessing the configuration above
|
// custom behaviour accessing the configuration above
|
||||||
StrolchLocalizeBehaviorImpl = {
|
StrolchLocalizeBehaviorImpl = {
|
||||||
attached: function() {
|
attached: function () {
|
||||||
var locale = Strolch.getUserLocale();
|
var locale = Strolch.getUserLocale();
|
||||||
|
|
||||||
// load the language resource of the configured language
|
// load the language resource of the configured language
|
||||||
this.language = locale;
|
this.language = locale;
|
||||||
this.useKeyIfMissing = true;
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue