From ddec42a0050eae1d6550acb455bc286c8b63247a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=C5=9Aliwa?= Date: Fri, 31 Jan 2025 23:32:11 +0100 Subject: [PATCH 1/2] fix: bring back i18next infrastructure --- packages/cli/src/infrastructures/i18next.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/cli/src/infrastructures/i18next.ts 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(), + }); +}; From cb050a39333b01b3b01c2f8a75d6a25c94b43a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=C5=9Aliwa?= Date: Fri, 31 Jan 2025 23:33:20 +0100 Subject: [PATCH 2/2] chore: changeset --- .changeset/tasty-plants-hug.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tasty-plants-hug.md 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.