diff --git a/.changeset/tasty-plants-hug.md b/.changeset/tasty-plants-hug.md new file mode 100644 index 0000000000..e5f5cb7d37 --- /dev/null +++ b/.changeset/tasty-plants-hug.md @@ -0,0 +1,5 @@ +--- +"@vue-storefront/cli": patch +--- + +[FIXED] Added back missing i18next infrastructure file to fix CLI error. diff --git a/packages/cli/src/infrastructures/i18next.ts b/packages/cli/src/infrastructures/i18next.ts new file mode 100644 index 0000000000..a4ca77e4da --- /dev/null +++ b/packages/cli/src/infrastructures/i18next.ts @@ -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 => { + 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(), + }); +};