From 8855f878cbcde9d12cf754f417c839184ce0cbf1 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Thu, 10 Aug 2023 19:17:44 +0400 Subject: [PATCH] ezqms-245: allow configurable languages per deployments (#3579) Signed-off-by: Alexey Zinoviev --- dev/prod/src/platform.ts | 4 ++++ .../components/internal/LangSelector.svelte | 24 +++++++++++++++++-- .../ui/src/components/internal/Root.svelte | 2 +- packages/ui/src/plugin.ts | 1 + server/front/src/index.ts | 2 ++ server/front/src/starter.ts | 2 ++ 6 files changed, 32 insertions(+), 3 deletions(-) diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 3e701f1bb4..a6e848bd4c 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -90,6 +90,7 @@ interface Config { GMAIL_URL: string CALENDAR_URL: string TITLE?: string + LANGUAGES?: string DEFAULT_LANGUAGE?: string } @@ -117,6 +118,9 @@ export async function configurePlatform() { setMetadata(uiPlugin.metadata.DefaultApplication, login.component.LoginApp) + const languages = config.LANGUAGES ? (config.LANGUAGES as string).split(',').map((l) => l.trim()) : ['en', 'ru'] + + setMetadata(uiPlugin.metadata.Languages, languages) setMetadata( uiPlugin.metadata.Routes, new Map([ diff --git a/packages/ui/src/components/internal/LangSelector.svelte b/packages/ui/src/components/internal/LangSelector.svelte index 43abd741d8..8d09c76370 100644 --- a/packages/ui/src/components/internal/LangSelector.svelte +++ b/packages/ui/src/components/internal/LangSelector.svelte @@ -14,6 +14,7 @@ -->