From 8777e65996edb2e9421569ff75905d26cf5d3f8d Mon Sep 17 00:00:00 2001 From: caranicas Date: Mon, 19 Sep 2022 10:57:31 -0400 Subject: [PATCH] work on identical keys --- ui/frontend/build_src/.eslintrc | 16 +++++++- .../build_src/src/Translation/config.ts | 3 +- .../{en.json => locales/en/home.json} | 0 .../src/Translation/locales/es/home.json | 38 +++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) rename ui/frontend/build_src/src/Translation/{en.json => locales/en/home.json} (100%) create mode 100644 ui/frontend/build_src/src/Translation/locales/es/home.json diff --git a/ui/frontend/build_src/.eslintrc b/ui/frontend/build_src/.eslintrc index a19fc59d..aa90a738 100644 --- a/ui/frontend/build_src/.eslintrc +++ b/ui/frontend/build_src/.eslintrc @@ -1,10 +1,12 @@ { "root": true, "parser": "@typescript-eslint/parser", + "plugins": ["i18n-json"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", - "plugin:i18next/recommended" + "plugin:i18next/recommended", + "plugin:i18n-json/recommended" ], "rules": { "@typescript-eslint/ban-ts-comment": "off", @@ -12,5 +14,17 @@ "prefer-const": "off", "no-debugger": "warn", "i18next/no-literal-string": "warn" + // "i18n-json/identical-keys": [ + // "error", + // { + // "filePath": { + // "home.json/": "./Translation/locales/en/home.json" + // } + // } + // ], + // "i18n-json/valid-message-syntax": [ + // "error", + // { "syntax": "non-empty-string" } + // ] } } diff --git a/ui/frontend/build_src/src/Translation/config.ts b/ui/frontend/build_src/src/Translation/config.ts index 84c09792..8b1ec200 100644 --- a/ui/frontend/build_src/src/Translation/config.ts +++ b/ui/frontend/build_src/src/Translation/config.ts @@ -1,5 +1,6 @@ import i18n from "i18next"; -import translation from "./en.json"; +// this should be updated to an interface +import translation from "./locales/en/home.json"; import { initReactI18next } from "react-i18next"; export const resources = { diff --git a/ui/frontend/build_src/src/Translation/en.json b/ui/frontend/build_src/src/Translation/locales/en/home.json similarity index 100% rename from ui/frontend/build_src/src/Translation/en.json rename to ui/frontend/build_src/src/Translation/locales/en/home.json diff --git a/ui/frontend/build_src/src/Translation/locales/es/home.json b/ui/frontend/build_src/src/Translation/locales/es/home.json new file mode 100644 index 00000000..0663ea26 --- /dev/null +++ b/ui/frontend/build_src/src/Translation/locales/es/home.json @@ -0,0 +1,38 @@ +{ + "title": "Stable Diffusion UI", + "description": "", + "navbar": { + }, + "land-cre": { + }, + "land-pre": { + }, + "home": { + }, + "in-paint": { + }, + "settings": { + + }, + "tags": { + + }, + "preview-prompt": { + + }, + "current-task": "", + "recent-create": "", + "popup": { + }, + "history": { + }, + "advanced-settings": { + + }, + "storage": { + + }, + "import": { + }, + "about": "" +}