From a88e99dcfb578c8c7bd4f946df409aab8ede6071 Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Mon, 10 Mar 2025 18:27:13 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=8D=20i18n:=20Refactor=20terms=20conte?= =?UTF-8?q?nt=20structure=20and=20update=20paths=20for=20multi-language=20?= =?UTF-8?q?support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/routes/Root.tsx | 2 +- client/src/utils/index.ts | 1 + client/src/{terms => utils}/termsContent.ts | 6 +++--- deploy-compose.yml | 4 ++-- docker-compose.yml | 1 + {client/src/terms => terms}/terms_de.md | 0 {client/src/terms => terms}/terms_en.md | 0 {client/src/terms => terms}/terms_fr.md | 0 8 files changed, 8 insertions(+), 6 deletions(-) rename client/src/{terms => utils}/termsContent.ts (89%) rename {client/src/terms => terms}/terms_de.md (100%) rename {client/src/terms => terms}/terms_en.md (100%) rename {client/src/terms => terms}/terms_fr.md (100%) diff --git a/client/src/routes/Root.tsx b/client/src/routes/Root.tsx index e8dce9617e..37b671978c 100644 --- a/client/src/routes/Root.tsx +++ b/client/src/routes/Root.tsx @@ -11,9 +11,9 @@ import { import { useAuthContext, useAssistantsMap, useAgentsMap, useFileMap, useSearch } from '~/hooks'; import TermsAndConditionsModal from '~/components/ui/TermsAndConditionsModal'; import { useUserTermsQuery, useGetStartupConfig } from '~/data-provider'; -import { getTermsMarkdown } from '~/terms/termsContent'; import { Nav, MobileNav } from '~/components/Nav'; import { Banner } from '~/components/Banners'; +import { getTermsMarkdown } from '~/utils'; import { useRecoilValue } from 'recoil'; import store from '~/store'; diff --git a/client/src/utils/index.ts b/client/src/utils/index.ts index 1a295837f4..2c9910bd1e 100644 --- a/client/src/utils/index.ts +++ b/client/src/utils/index.ts @@ -15,6 +15,7 @@ export * from './languages'; export * from './endpoints'; export * from './localStorage'; export * from './promptGroups'; +export * from './termsContent'; export { default as cn } from './cn'; export { default as logger } from './logger'; export { default as buildTree } from './buildTree'; diff --git a/client/src/terms/termsContent.ts b/client/src/utils/termsContent.ts similarity index 89% rename from client/src/terms/termsContent.ts rename to client/src/utils/termsContent.ts index 164d92dd83..b66dc8da9a 100644 --- a/client/src/terms/termsContent.ts +++ b/client/src/utils/termsContent.ts @@ -1,6 +1,6 @@ -import terms_en from './terms_en.md?raw'; -import terms_de from './terms_de.md?raw'; -import terms_fr from './terms_fr.md?raw'; +import terms_en from '../../../terms/terms_en.md?raw'; +import terms_de from '../../../terms/terms_de.md?raw'; +import terms_fr from '../../../terms/terms_fr.md?raw'; /** * A mapping of language codes to their respective terms markdown content. diff --git a/deploy-compose.yml b/deploy-compose.yml index ae61265a05..14bf39f5be 100644 --- a/deploy-compose.yml +++ b/deploy-compose.yml @@ -13,7 +13,7 @@ services: - rag_api restart: always extra_hosts: - - "host.docker.internal:host-gateway" + - "host.docker.internal:host-gateway" env_file: - .env environment: @@ -30,7 +30,7 @@ services: - ./images:/app/client/public/images - ./uploads:/app/uploads - ./logs:/app/api/logs - + - ./terms:/app/terms client: image: nginx:1.27.0-alpine container_name: LibreChat-NGINX diff --git a/docker-compose.yml b/docker-compose.yml index e16f93f4c0..17617ca001 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,6 +27,7 @@ services: - ./images:/app/client/public/images - ./uploads:/app/uploads - ./logs:/app/api/logs + - ./terms:/app/terms mongodb: container_name: chat-mongodb image: mongo diff --git a/client/src/terms/terms_de.md b/terms/terms_de.md similarity index 100% rename from client/src/terms/terms_de.md rename to terms/terms_de.md diff --git a/client/src/terms/terms_en.md b/terms/terms_en.md similarity index 100% rename from client/src/terms/terms_en.md rename to terms/terms_en.md diff --git a/client/src/terms/terms_fr.md b/terms/terms_fr.md similarity index 100% rename from client/src/terms/terms_fr.md rename to terms/terms_fr.md