Skip to content

Commit

Permalink
fix(es-1464): fix cli module import error (#7377)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsliwaradioluz authored Feb 1, 2025
1 parent 1f0ab35 commit d94e4e4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-plants-hug.md
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.
18 changes: 18 additions & 0 deletions packages/cli/src/infrastructures/i18next.ts
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(),
});
};

0 comments on commit d94e4e4

Please sign in to comment.