Skip to content

Commit

Permalink
build 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rehhouari committed Oct 22, 2021
1 parent b29a025 commit e290358
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 28 deletions.
17 changes: 8 additions & 9 deletions packages/main/dist/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var localeChange = new Event("alpine-i18n:locale-change");
var i18nReady = new Event("alpine-i18n:ready");
var AlpineI18n = {
version: "2.1.1",
version: "2.2.0",
set locale(name) {
this.checkLocale(name);
this.currentLocale = name;
Expand All @@ -26,16 +26,15 @@
}
},
t(name, vars) {
let message = name;
let message = "";
try {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.locale]);
} catch (error) {
console.warn("AlpineI18n: key " + name + " not found. Using fallbackLocale.");
if (this.fallbackLocale.length) {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.fallbackLocale]);
} else {
return name;
}
} catch {
}
if (!message && this.fallbackLocale.length) {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.fallbackLocale]);
} else if (!message) {
return name;
}
for (const key in vars) {
if (Object.prototype.hasOwnProperty.call(vars, key)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/dist/cdn.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions packages/main/dist/module.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ __export(exports, {
var localeChange = new Event("alpine-i18n:locale-change");
var i18nReady = new Event("alpine-i18n:ready");
var AlpineI18n = {
version: "2.1.1",
version: "2.2.0",
set locale(name) {
this.checkLocale(name);
this.currentLocale = name;
Expand All @@ -38,16 +38,15 @@ var AlpineI18n = {
}
},
t(name, vars) {
let message = name;
let message = "";
try {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.locale]);
} catch (error) {
console.warn("AlpineI18n: key " + name + " not found. Using fallbackLocale.");
if (this.fallbackLocale.length) {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.fallbackLocale]);
} else {
return name;
}
} catch {
}
if (!message && this.fallbackLocale.length) {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.fallbackLocale]);
} else if (!message) {
return name;
}
for (const key in vars) {
if (Object.prototype.hasOwnProperty.call(vars, key)) {
Expand Down
17 changes: 8 additions & 9 deletions packages/main/dist/module.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var localeChange = new Event("alpine-i18n:locale-change");
var i18nReady = new Event("alpine-i18n:ready");
var AlpineI18n = {
version: "2.1.1",
version: "2.2.0",
set locale(name) {
this.checkLocale(name);
this.currentLocale = name;
Expand All @@ -25,16 +25,15 @@ var AlpineI18n = {
}
},
t(name, vars) {
let message = name;
let message = "";
try {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.locale]);
} catch (error) {
console.warn("AlpineI18n: key " + name + " not found. Using fallbackLocale.");
if (this.fallbackLocale.length) {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.fallbackLocale]);
} else {
return name;
}
} catch {
}
if (!message && this.fallbackLocale.length) {
message = name.split(".").reduce((o, i) => o[i], this.messages[this.fallbackLocale]);
} else if (!message) {
return name;
}
for (const key in vars) {
if (Object.prototype.hasOwnProperty.call(vars, key)) {
Expand Down

0 comments on commit e290358

Please sign in to comment.