From fab89a76b1f2852253e4e3b74127eaffdf0c8bab Mon Sep 17 00:00:00 2001 From: Ased Mammad Date: Fri, 1 Mar 2024 08:10:36 +0330 Subject: [PATCH] feat: WIP: Initial setup for i18next --- package.json | 5 ++- src/lib/components/chat/MessageInput.svelte | 8 +++-- .../chat/MessageInput/Models.svelte | 4 ++- .../chat/Messages/Placeholder.svelte | 8 +++-- src/lib/components/chat/ModelSelector.svelte | 10 ++++-- .../components/chat/Settings/General.svelte | 26 +++++++++++++- .../components/chat/Settings/Images.svelte | 8 +++-- .../components/chat/Settings/Interface.svelte | 6 ++-- .../components/chat/Settings/Models.svelte | 13 ++++--- src/lib/components/layout/Sidebar.svelte | 8 +++-- src/lib/i18n/index.ts | 30 ++++++++++++++++ src/lib/i18n/locales/de/common.json | 10 ++++++ src/lib/i18n/locales/en/common.json | 10 ++++++ src/lib/i18n/locales/fa/common.json | 10 ++++++ src/lib/i18n/locales/fr/common.json | 10 ++++++ src/lib/i18n/store.ts | 34 +++++++++++++++++++ src/routes/+layout.svelte | 5 ++- 17 files changed, 180 insertions(+), 25 deletions(-) create mode 100644 src/lib/i18n/index.ts create mode 100644 src/lib/i18n/locales/de/common.json create mode 100644 src/lib/i18n/locales/en/common.json create mode 100644 src/lib/i18n/locales/fa/common.json create mode 100644 src/lib/i18n/locales/fr/common.json create mode 100644 src/lib/i18n/store.ts diff --git a/package.json b/package.json index 0e95102d4..786175b07 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,9 @@ "dayjs": "^1.11.10", "file-saver": "^2.0.5", "highlight.js": "^11.9.0", + "i18next": "^23.10.0", + "i18next-browser-languagedetector": "^7.2.0", + "i18next-resources-to-backend": "^1.2.0", "idb": "^7.1.1", "js-sha256": "^0.10.1", "katex": "^0.16.9", @@ -53,4 +56,4 @@ "tippy.js": "^6.3.7", "uuid": "^9.0.1" } -} \ No newline at end of file +} diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 022ee4fb4..3c418be3f 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -1,6 +1,6 @@