Skip to content

Commit d94e4e4

Browse files
fix(es-1464): fix cli module import error (#7377)
1 parent 1f0ab35 commit d94e4e4

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.changeset/tasty-plants-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-storefront/cli": patch
3+
---
4+
5+
[FIXED] Added back missing i18next infrastructure file to fix CLI error.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import path from "path";
2+
import i18next from "i18next";
3+
import Backend from "i18next-fs-backend";
4+
import getLocale from "os-locale";
5+
6+
export const setupI18Next = async (): Promise<void> => {
7+
await i18next.use(Backend).init({
8+
backend: {
9+
loadPath: path.resolve(__dirname, "../../locales/{{lng}}/{{ns}}.json"),
10+
},
11+
fallbackLng: "en-US",
12+
interpolation: {
13+
// Escaping is only required to prevent XSS attacks in the front-end
14+
escapeValue: false,
15+
},
16+
lng: await getLocale(),
17+
});
18+
};

0 commit comments

Comments
 (0)