-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es-1464): fix cli module import error (#7377)
- Loading branch information
1 parent
1f0ab35
commit d94e4e4
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@vue-storefront/cli": patch | ||
--- | ||
|
||
[FIXED] Added back missing i18next infrastructure file to fix CLI error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import path from "path"; | ||
import i18next from "i18next"; | ||
import Backend from "i18next-fs-backend"; | ||
import getLocale from "os-locale"; | ||
|
||
export const setupI18Next = async (): Promise<void> => { | ||
await i18next.use(Backend).init({ | ||
backend: { | ||
loadPath: path.resolve(__dirname, "../../locales/{{lng}}/{{ns}}.json"), | ||
}, | ||
fallbackLng: "en-US", | ||
interpolation: { | ||
// Escaping is only required to prevent XSS attacks in the front-end | ||
escapeValue: false, | ||
}, | ||
lng: await getLocale(), | ||
}); | ||
}; |