Skip to content

Commit

Permalink
Address feedback on pending locale
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrotule committed Feb 2, 2021
1 parent 578f42a commit 03af633
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/templates/plugin.main.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ export default async (context) => {
}

const waitForPendingLocale = async () => {
return !app.i18n.__pendingLocale || (await app.i18n.__pendingLocalePromise)
if (app.i18n.__pendingLocale) {
await app.i18n.__pendingLocalePromise
}
}

const getBrowserLocale = () => {
Expand Down Expand Up @@ -286,6 +288,9 @@ export default async (context) => {
i18n.waitForPendingLocale = waitForPendingLocale
i18n.getBrowserLocale = () => getBrowserLocale()
i18n.__baseUrl = app.i18n.__baseUrl
i18n.__pendingLocale = app.i18n.__pendingLocale
i18n.__pendingLocalePromise = app.i18n.__pendingLocalePromise
i18n.__resolvePendingLocalePromise = app.i18n.__resolvePendingLocalePromise
}

// Set instance options
Expand Down

0 comments on commit 03af633

Please sign in to comment.