From b9f53abf3713daa207665c0d66583f9a18e9f78b Mon Sep 17 00:00:00 2001 From: Jannik Streidl Date: Tue, 5 Mar 2024 09:30:00 +0100 Subject: [PATCH] fix: show translated user role in admin panel --- src/lib/i18n/locales/de/common.json | 6 +++--- src/lib/i18n/locales/en/common.json | 6 +++--- src/lib/i18n/locales/fa/common.json | 6 +++--- src/routes/(app)/admin/+page.svelte | 8 +++----- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/lib/i18n/locales/de/common.json b/src/lib/i18n/locales/de/common.json index 0ca82f7a7..51f28cba8 100644 --- a/src/lib/i18n/locales/de/common.json +++ b/src/lib/i18n/locales/de/common.json @@ -16,7 +16,7 @@ "Add LiteLLM Model": "LiteLLM Modell hinzufügen", "add tags": "Tags hinzufügen", "Adjusting these settings will apply changes universally to all users.": "Das Anpassen dieser Einstellungen wirkt sich universell auf alle Benutzer aus.", - "Admin": "Admin", + "admin": "Administrator", "Admin Panel": "Admin Panel", "Admin Settings": "Admin Einstellungen", "Advanced": "Angepasst", @@ -206,7 +206,7 @@ "or": "oder", "Parameters": "Parameter", "Password": "Passwort", - "Pending": "Ausstehend", + "pending": "ausstehend", "Permission denied when accessing microphone: {{error}}": "Zugriff auf das Mikrofon verweigert: {{error}}", "Profile": "Profil", "Prompt Content": "Prompt-Inhalt", @@ -295,7 +295,7 @@ "Upload Progress": "Upload-Fortschritt", "URL Mode": "URL-Modus", "Use '#' in the prompt input to load and select your documents.": "Verwenden Sie '#' in der Prompt-Eingabe, um Ihre Dokumente zu laden und auszuwählen.", - "User": "Benutzer", + "user": "Benutzer", "User Permissions": "Benutzerberechtigungen", "Users": "Benutzer", "Utilize": "Nutzen Sie die", diff --git a/src/lib/i18n/locales/en/common.json b/src/lib/i18n/locales/en/common.json index 3f1899d56..f2ce650db 100644 --- a/src/lib/i18n/locales/en/common.json +++ b/src/lib/i18n/locales/en/common.json @@ -16,7 +16,7 @@ "Add LiteLLM Model": "Add LiteLLM Model", "add tags": "add tags", "Adjusting these settings will apply changes universally to all users.": "Adjusting these settings will apply changes universally to all users.", - "Admin": "Admin", + "admin": "Admin", "Admin Panel": "Admin Panel", "Admin Settings": "Admin Settings", "Advanced": "Advanced", @@ -206,7 +206,7 @@ "or": "or", "Parameters": "Parameters", "Password": "Password", - "Pending": "Pending", + "pending": "Pending", "Permission denied when accessing microphone: {{error}}": "Permission denied when accessing microphone: {{error}}", "Profile": "Profile", "Prompt Content": "Prompt Content", @@ -295,7 +295,7 @@ "Upload Progress": "Upload Progress", "URL Mode": "URL Mode", "Use '#' in the prompt input to load and select your documents.": "Use '#' in the prompt input to load and select your documents.", - "User": "User", + "user": "User", "User Permissions": "User Permissions", "Users": "Users", "Utilize": "Utilize", diff --git a/src/lib/i18n/locales/fa/common.json b/src/lib/i18n/locales/fa/common.json index 750e6899a..8de424e7e 100644 --- a/src/lib/i18n/locales/fa/common.json +++ b/src/lib/i18n/locales/fa/common.json @@ -7,7 +7,7 @@ "Add Files": "اضافه کردن فایل‌ها", "Add LiteLLM Model": "اضافه کردن مدل LiteLLM", "add tags": "اضافه کردن تگ‌ها", - "Admin": "مدیریت", + "admin": "مدیریت", "Admin Panel": "پنل مدیریت", "Admin Settings": "تنظیمات مدیریت", "Advanced Model Params": "پارامترهای پیشرفته مدل", @@ -161,7 +161,7 @@ "or": "روشن", "Parameters": "پارامترها", "Password": "رمز عبور", - "Pending": "Pending", + "pending": "Pending", "Permission denied when accessing microphone: {{error}}": "هنگام دسترسی به میکروفون، اجازه داده نشد: {{error}}", "Profile": "پروفایل", "Prompt Content": "محتویات پرامپت", @@ -238,7 +238,7 @@ "URL Mode": "حالت URL", "User Permissions": "مجوزهای کاربر", "Users": "کاربران", - "User": "کاربر", + "user": "کاربر", "WebUI Add-ons": "WebUI افزونه‌های", "{{webUIName}} Backend Required": "بکند {{webUIName}} نیاز است.", "WebUI Settings": "تنظیمات WebUI", diff --git a/src/routes/(app)/admin/+page.svelte b/src/routes/(app)/admin/+page.svelte index 3be247795..a94b20f52 100644 --- a/src/routes/(app)/admin/+page.svelte +++ b/src/routes/(app)/admin/+page.svelte @@ -39,7 +39,7 @@ }); if (res) { users = await getUsers(localStorage.token); - toast.success($i18n.t('Successfully updated.')); + toast.success($i18n.t('Successfully updated')); } }; @@ -64,9 +64,7 @@ - - {`Admin Panel | ${$WEBUI_NAME}`} - + {$i18n.t('Admin Panel')} | `${$WEBUI_NAME}` {#key selectedUser} @@ -165,7 +163,7 @@ 'bg-green-600 dark:bg-green-300'} {user.role === 'pending' && 'bg-gray-600 dark:bg-gray-300'}" /> - {user.role}