From fa33c94944c0d99e854d1a443aa26f3b4d5980e0 Mon Sep 17 00:00:00 2001 From: u80861711 Date: Mon, 1 Sep 2025 17:11:16 +0200 Subject: [PATCH] use the configuration languages for all Title Models, Suggested Prompts and Banners. So this is now ready for translations globally --- backend/open_webui/utils/models.py | 1 + .../admin/Settings/Interface.svelte | 2 +- .../admin/Settings/Interface/Banners.svelte | 298 +++++++++++++----- src/lib/components/common/Banner.svelte | 4 +- .../workspace/Models/ModelEditor.svelte | 169 +++++----- src/lib/i18n/index.ts | 66 ++++ src/lib/stores/index.ts | 1 + 7 files changed, 380 insertions(+), 161 deletions(-) diff --git a/backend/open_webui/utils/models.py b/backend/open_webui/utils/models.py index 6eb5d3f4b1..b53d71a181 100644 --- a/backend/open_webui/utils/models.py +++ b/backend/open_webui/utils/models.py @@ -233,6 +233,7 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None) if "filterIds" in meta: filter_ids.extend(meta["filterIds"]) + custom_model.name = translate_model_title(custom_model.name, request.headers.get("X-Language")) models.append( { "id": f"{custom_model.id}", diff --git a/src/lib/components/admin/Settings/Interface.svelte b/src/lib/components/admin/Settings/Interface.svelte index 86507f7c08..4fe01b5e2e 100644 --- a/src/lib/components/admin/Settings/Interface.svelte +++ b/src/lib/components/admin/Settings/Interface.svelte @@ -408,7 +408,7 @@ id: uuidv4(), type: '', title: '', - content: '', + content: JSON.stringify({ de: '', en: '', fr: '', it: '' }), dismissible: true, timestamp: Math.floor(Date.now() / 1000) } diff --git a/src/lib/components/admin/Settings/Interface/Banners.svelte b/src/lib/components/admin/Settings/Interface/Banners.svelte index 6b96374d5e..1456c18c80 100644 --- a/src/lib/components/admin/Settings/Interface/Banners.svelte +++ b/src/lib/components/admin/Settings/Interface/Banners.svelte @@ -1,102 +1,228 @@ -
- {#each banners as banner, bannerIdx (banner.id)} -