From d826cda2a0c6d3e128f7021cb2922b986b00ca53 Mon Sep 17 00:00:00 2001 From: dec0dOS Date: Wed, 1 May 2024 14:11:05 +0100 Subject: [PATCH] chore: move localesList to generated folder --- frontend/src/components/Settings/Settings.jsx | 2 +- frontend/src/generated/localesList.json | 10 ++++++++++ frontend/vite-plugin-generate-locales.js | 2 +- frontend/vite.config.js | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 frontend/src/generated/localesList.json diff --git a/frontend/src/components/Settings/Settings.jsx b/frontend/src/components/Settings/Settings.jsx index 801ef1b..a81a1d8 100644 --- a/frontend/src/components/Settings/Settings.jsx +++ b/frontend/src/components/Settings/Settings.jsx @@ -9,7 +9,7 @@ import { import ExpandMoreIcon from "@material-ui/icons/ExpandMore"; import { useTranslation } from "react-i18next"; -import localesList from "utils/localesList.json"; +import localesList from "generated/localesList.json"; function Settings() { const { t, i18n } = useTranslation(); diff --git a/frontend/src/generated/localesList.json b/frontend/src/generated/localesList.json new file mode 100644 index 0000000..35f6fb1 --- /dev/null +++ b/frontend/src/generated/localesList.json @@ -0,0 +1,10 @@ +[ + { + "code": "en", + "name": "English" + }, + { + "code": "es-ES", + "name": "EspaƱol" + } +] diff --git a/frontend/vite-plugin-generate-locales.js b/frontend/vite-plugin-generate-locales.js index 27e4141..a2f4289 100644 --- a/frontend/vite-plugin-generate-locales.js +++ b/frontend/vite-plugin-generate-locales.js @@ -37,7 +37,7 @@ export default function GenerateLocalesPlugin() { const outputPath = path.resolve( __dirname, "src", - "utils", + "generated", "localesList.json" ); fs.writeFileSync(outputPath, JSON.stringify(localesList, null, 2)); diff --git a/frontend/vite.config.js b/frontend/vite.config.js index a8265c1..d7fcd87 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -22,6 +22,7 @@ export default defineConfig({ components: "/src/components", utils: "/src/utils", external: "/src/external", + generated: "/src/generated", }, }, build: {