Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rehhouari committed Oct 22, 2021
1 parent 3c3f4d6 commit 90342dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ const AlpineI18n = {
* @returns string
*/
t(name: string, vars?: { [name: string]: any }) {
let message: string = name
try {
let message: string = name
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) {
let message = name
message = name
.split('.')
.reduce((o, i) => o[i], this.messages[this.fallbackLocale]);
} else {
Expand Down

0 comments on commit 90342dc

Please sign in to comment.