diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 7b8a8aad..7e98a706 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -216,7 +216,7 @@ // Event triggered when an error occurs speechRecognition.onerror = function (event) { console.log(event); - toast.error(`Speech recognition error: ${event.error}`); + toast.error($i18n.t(`Speech recognition error: {{error}}`, { error: event.error })); isRecording = false; }; } else { diff --git a/src/lib/components/chat/MessageInput/Models.svelte b/src/lib/components/chat/MessageInput/Models.svelte index 76892a13..632d5650 100644 --- a/src/lib/components/chat/MessageInput/Models.svelte +++ b/src/lib/components/chat/MessageInput/Models.svelte @@ -111,7 +111,9 @@ toast.error(error.error); } } else { - toast.error($i18n.t('Uh-oh! There was an issue connecting to llama.')); + toast.error( + $i18n.t('Uh-oh! There was an issue connecting to {{provider}}.', { provider: 'llama' }) + ); } } diff --git a/src/lib/components/chat/Settings/Audio.svelte b/src/lib/components/chat/Settings/Audio.svelte index 0f286be7..ae440910 100644 --- a/src/lib/components/chat/Settings/Audio.svelte +++ b/src/lib/components/chat/Settings/Audio.svelte @@ -115,7 +115,11 @@ on:change={(e) => { if (e.target.value !== '') { navigator.mediaDevices.getUserMedia({ audio: true }).catch(function (err) { - toast.error(`Permission denied when accessing microphone: ${err}`); + toast.error( + $i18n.t(`Permission denied when accessing microphone: {{error}}`, { + error: err + }) + ); STTEngine = ''; }); } diff --git a/src/lib/components/chat/Settings/Images.svelte b/src/lib/components/chat/Settings/Images.svelte index c5f97037..5361680c 100644 --- a/src/lib/components/chat/Settings/Images.svelte +++ b/src/lib/components/chat/Settings/Images.svelte @@ -79,7 +79,7 @@ } } else { enableImageGeneration = false; - toast.error('AUTOMATIC1111_BASE_URL not provided'); + toast.error($i18n.t('{{item}} not provided', { item: 'AUTOMATIC1111_BASE_URL' })); } }; diff --git a/src/lib/components/chat/Settings/Models.svelte b/src/lib/components/chat/Settings/Models.svelte index 9d5e5d2b..b467ef5b 100644 --- a/src/lib/components/chat/Settings/Models.svelte +++ b/src/lib/components/chat/Settings/Models.svelte @@ -56,11 +56,17 @@ const pullModelHandler = async () => { const sanitizedModelTag = modelTag.trim(); if (modelDownloadStatus[sanitizedModelTag]) { - toast.error(`Model '${sanitizedModelTag}' is already in queue for downloading.`); + toast.error( + $i18n.t(`Model '{{modelTag}}' is already in queue for downloading.`, { + modelTag: sanitizedModelTag + }) + ); return; } if (Object.keys(modelDownloadStatus).length === 3) { - toast.error('Maximum of 3 models can be downloaded simultaneously. Please try again later.'); + toast.error( + $i18n.t('Maximum of 3 models can be downloaded simultaneously. Please try again later.') + ); return; } @@ -78,10 +84,10 @@ if (!data.success) { toast.error(data.error); } else { - toast.success($i18n.t(`Model '${modelName}' has been successfully downloaded.`)); + toast.success($i18n.t(`Model '{{modelName}}' has been successfully downloaded.`, {modelName})); const notification = new Notification($WEBUI_NAME, { - body: `Model '${modelName}' has been successfully downloaded.`, + body: $i18n.t(`Model '{{modelName}}' has been successfully downloaded.`, {modelName}), icon: `${WEBUI_BASE_URL}/static/favicon.png` }); @@ -243,7 +249,7 @@ }); if (res) { - toast.success($i18n.t(`Deleted ${deleteModelTag}`)); + toast.success($i18n.t(`Deleted {{deleteModelTag}}`, {deleteModelTag})); } deleteModelTag = ''; @@ -327,7 +333,7 @@ } } } else { - toast.error(`Model ${liteLLMModelName} already exists.`); + toast.error($i18n.t(`Model {{modelName}} already exists.`, { modelName: liteLLMModelName })); } liteLLMModelName = ''; diff --git a/src/lib/components/documents/AddDocModal.svelte b/src/lib/components/documents/AddDocModal.svelte index 2dc4d3ed..8b0936b4 100644 --- a/src/lib/components/documents/AddDocModal.svelte +++ b/src/lib/components/documents/AddDocModal.svelte @@ -73,7 +73,7 @@ inputFiles = null; document.getElementById('upload-doc-input').value = ''; } else { - toast.error(`File not found.`); + toast.error($i18n.t(`File not found.`)); } show = false; diff --git a/src/lib/i18n/locales/en/common.json b/src/lib/i18n/locales/en/common.json index e5136885..95f8834a 100644 --- a/src/lib/i18n/locales/en/common.json +++ b/src/lib/i18n/locales/en/common.json @@ -61,7 +61,7 @@ "Delete a model": "Delete a model", "Delete chat": "Delete chat", "Delete Chats": "Delete Chats", - "Deleted ${deleteModelTag}`": "Deleted ${deleteModelTag}`", + "Deleted {{deleteModelTag}}": "Deleted {{deleteModelTag}}", "delete": "delete", "Deleted {tagName}": "Deleted {tagName}", "Description": "Description", @@ -105,6 +105,7 @@ "Import Modelfiles": "Import Modelfiles", "Import Prompts": "Import Prompts", "Interface": "Interface", + "{{item}} not provided": "{{item}} not provided", "join our Discord for help.": "join our Discord for help.", "JSON": "JSON", "JWT Expiration": "JWT Expiration", @@ -120,17 +121,22 @@ "LLMs can make mistakes. Verify important information.": "LLMs can make mistakes. Verify important information.", "Made by OpenWebUI Community": "Made by OpenWebUI Community", "Manage LiteLLM Models": "Manage LiteLLM Models", + "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "Maximum of 3 models can be downloaded simultaneously. Please try again later.", "Max Tokens": "Max Tokens", "Mirostat Eta": "Mirostat Eta", "Mirostat": "Mirostat", "Mirostat Tau": "Mirostat Tau", - "Model '${modelName}' has been successfully downloaded.`": "Model '${modelName}' has been successfully downloaded.`", + "Model '{{modelName}}' has been successfully downloaded.`": "Model '{{modelName}}' has been successfully downloaded.`", "Modelfile Advanced Settings": "Modelfile Advanced Settings", "Modelfile Content": "Modelfile Content", "Modelfile": "Modelfile", "Modelfiles": "Modelfiles", + "Model {{modelId}} not found": "Model {{modelId}} not found", + "Model {{modelName}} already exists.": "Model {{modelName}} already exists.", + "Model '{{modelTag}}' is already in queue for downloading.": "Model '{{modelTag}}' is already in queue for downloading.", "{{modelName}} is thinking...": "{{modelName}} is thinking...", "Model Name": "Model Name", + "Model not selected": "Model not selected", "Models": "Models", "Model Tag Name": "Model Tag Name", "My Documents": "My Documents", @@ -146,7 +152,9 @@ "Okay, Let's Go!": "Okay, Let's Go!", "Ollama API URL": "Ollama API URL", "Ollama Version": "Ollama Version", + "Only alphanumeric characters and hyphens are allowed in the command string.": "Only alphanumeric characters and hyphens are allowed in the command string.", "On": "On", + "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.": "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.", "OpenAI API": "OpenAI API", "Open AI": "Open AI", "Open new chat": "Open new chat", @@ -154,6 +162,7 @@ "Parameters": "Parameters", "Password": "Password", "Pending": "Pending", + "Permission denied when accessing microphone: {{error}}": "Permission denied when accessing microphone: {{error}}", "Profile": "Profile", "Prompt Content": "Prompt Content", "Prompts": "Prompts", @@ -198,6 +207,7 @@ "Show shortcuts": "Show shortcuts", "Sign Out": "Sign Out", "SpeechRecognition API is not supported in this browser.": "SpeechRecognition API is not supported in this browser.", + "Speech recognition error: {{error}}": "Speech recognition error: {{error}}", "Speech-to-Text Engine": "Speech-to-Text Engine", "Stop Sequence": "Stop Sequence", "STT Settings": "STT Settings", @@ -222,7 +232,7 @@ "Top K": "Top K", "Top P": "Top P", "TTS Settings": "TTS Settings", - "Uh-oh! There was an issue connecting to llama.": "Uh-oh! There was an issue connecting to llama.", + "Uh-oh! There was an issue connecting to {{provider}}.": "Uh-oh! There was an issue connecting to {{provider}}.", "Upload a GGUF model": "Upload a GGUF model", "Upload files": "Upload files", "Upload Progress": "Upload Progress", diff --git a/src/lib/i18n/locales/fa/common.json b/src/lib/i18n/locales/fa/common.json index 84720a8e..9aec2e42 100644 --- a/src/lib/i18n/locales/fa/common.json +++ b/src/lib/i18n/locales/fa/common.json @@ -6,7 +6,7 @@ "Add Docs": "اضافه کردن اسناد", "Add Files": "اضافه کردن فایل‌ها", "Add LiteLLM Model": "اضافه کردن مدل LiteLLM", - "add tags": "add tags", + "add tags": "اضافه کردن تگ‌ها", "Admin": "مدیریت", "Admin Panel": "پنل مدیریت", "Admin Settings": "تنظیمات مدیریت", @@ -14,12 +14,12 @@ "Advanced Parameters": "پارامترهای پیشرفته", "all": "همه", "Allow": "اجازه دادن", - "Allow Chat Deletion": "اجازه حذف چت", + "Allow Chat Deletion": "اجازه حذف گپ", "API Base URL": "API Base URL", "API Key": "API Key", "API RPM": "API RPM", "Audio": "صدا", - "AUTOMATIC1111 Base URL": "AUTOMATIC1111 Base URL", + "AUTOMATIC1111 Base URL": "پایه URL AUTOMATIC1111 ", "Auto-playback response": "پخش خودکار پاسخ ", "Auto-send input after 3 sec.": "به طور خودکار ورودی را پس از 3 ثانیه ارسال کن.", "Back": "بازگشت", @@ -28,15 +28,15 @@ "Categories": "دسته‌بندی‌ها", "Change Password": "تغییر رمز عبور", "Chat History": "تاریخچه‌ی گفتگو", - "Chat History is off for this browser.": "سابقه چت برای این مرورگر خاموش است.", - "Chats": "چت‌ها", - "Check Again": "Check Again", + "Chat History is off for this browser.": "سابقه گپ برای این مرورگر خاموش است.", + "Chats": "گپ‌ها", + "Check Again": "چک مجدد", "Choose a model before saving...": "قبل از ذخیره یک مدل را انتخاب کنید...", "Chunk Overlap": "همپوشانی تکه", "Chunk Params": "پارامترهای تکه", "Chunk Size": "اندازه تکه", "click here.": "اینجا کلیک کنید.", - "Click here to check other modelfiles.": "Click here to check other modelfiles.", + "Click here to check other modelfiles.": "برای بررسی سایر فایل‌های مدل اینجا را کلیک کنید.", "Collection": "مجموعه", "Command": "دستور", "Confirm Password": "تایید رمز عبور", @@ -47,7 +47,7 @@ "Copying to clipboard was successful!": "کپی کردن در کلیپ بورد با موفقیت انجام شد!", "Copy last code block": "کپی آخرین بلوک کد", "Copy last response": "کپی آخرین پاسخ", - "Create a modelfile": "Create a modelfile", + "Create a modelfile": "ایجاد یک فایل مدل", "Current Password": "رمز عبور فعلی", "Custom": "دلخواه", "Customize Ollama models for a specific purpose": "Customize Ollama models for a specific purpose", @@ -59,26 +59,26 @@ "Default User Role": "Default User Role", "Default (Web API)": "Default (Web API)", "Delete a model": "حذف یک مدل", - "Delete chat": "حذف چت", - "Delete Chats": "حذف چت‌ها", - "Deleted ${deleteModelTag}`": "Deleted ${deleteModelTag}`", + "Delete chat": "حذف گپ", + "Delete Chats": "حذف گپ‌ها", + "Deleted {{deleteModelTag}}": "{{deleteModelTag}} پاک شد", "delete": "حذف", "Deleted {tagName}": "{tagName} حذف شد", "Description": "توضیحات", "Disabled": "غیرفعال", - "Discover a modelfile": "Discover a modelfile", - "Discover a prompt": "Discover a prompt", - "Discover, download, and explore custom prompts": "Discover, download, and explore custom prompts", - "Discover, download, and explore model presets": "Discover, download, and explore model presets", + "Discover a modelfile": "فایل مدل را کشف کنید", + "Discover a prompt": "یک اعلان را کشف کنید", + "Discover, download, and explore custom prompts": "درخواست‌های سفارشی را کشف، دانلود و کاوش کنید", + "Discover, download, and explore model presets": "پیش تنظیمات مدل را کشف، دانلود و کاوش کنید", "Document": "سند", "Documents": "اسناد", "Document Settings": "تنظیمات سند", - "Don't Allow": "Don't Allow", + "Don't Allow": "اجازه نده", "Download as a File": "دانلود به صورت فایل", "Download Database": "دانلود پایگاه داده", "Edit Doc": "ویرایش سند", "Edit User": "ویرایش کاربر", - "Email": "Email", + "Email": "ایمیل", "Enabled": "فعال", "Enable New Sign Ups": "Enable New Sign Ups", "Experimental": "Experimental", @@ -105,6 +105,7 @@ "Import Modelfiles": "Import Modelfiles", "Import Prompts": "Import Prompts", "Interface": "رابط", + "{{item}} not provided": "{{item}} not provided", "join our Discord for help.": "برای کمک به Discord ما بپیوندید.", "JSON": "JSON", "JWT Expiration": "JWT Expiration", @@ -118,19 +119,24 @@ "LiteLLM API Key": "LiteLLM API Key", "LiteLLM API RPM": "LiteLLM API RPM", "LLMs can make mistakes. Verify important information.": "مدل‌های زبانی بزرگ می‌توانند اشتباه کنند. اطلاعات مهم را راستی‌آزمایی کنید.", - "Made by OpenWebUI Community": "Made by OpenWebUI Community", + "Made by OpenWebUI Community": "ساخته شده توسط OpenWebUI Community", "Manage LiteLLM Models": "Manage LiteLLM Models", - "Max Tokens": "Max Tokens", + "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "حداکثر 3 مدل را می توان به طور همزمان دانلود کرد. لطفاً بعداً دوباره امتحان کنید.", + "Max Tokens": "حداکثر توکن", "Mirostat Eta": "Mirostat Eta", "Mirostat": "Mirostat", "Mirostat Tau": "Mirostat Tau", - "Model '${modelName}' has been successfully downloaded.`": "Model '${modelName}' has been successfully downloaded.`", - "Modelfile Advanced Settings": "Modelfile Advanced Settings", - "Modelfile Content": "Modelfile Content", + "Model '{{modelName}}' has been successfully downloaded.`": "Model '{{modelName}}' has been successfully downloaded.`", + "Modelfile Advanced Settings": "تنظیمات پیشرفته فایل‌مدل", + "Modelfile Content": "محتویات فایل‌مدل", "Modelfile": "فایل مدل", "Modelfiles": "فایل‌های مدل", + "Model {{modelId}} not found": "Model {{modelId}} not found", + "Model {{modelName}} already exists.": "Model {{modelName}} already exists.", + "Model '{{modelTag}}' is already in queue for downloading.": "Model '{{modelTag}}' is already in queue for downloading.", "{{modelName}} is thinking...": "{{modelName}} در حال فکر کردن است...", "Model Name": "نام مدل", + "Model not selected": "Model not selected", "Models": "مدل‌ها", "Model Tag Name": "Model Tag Name", "My Documents": "اسناد من", @@ -138,22 +144,25 @@ "My Prompts": "درخواست‌های من", "Name": "نام", "Name Tag": "Name Tag", - "New Chat": "چت جدید", + "New Chat": "گپ جدید", "New Password": "رمز عبور جدید", "Notification": "اعلان", - "Not sure what to write? Switch to": "Not sure what to write? Switch to", + "Not sure what to write? Switch to": "مطمئن نیستید چه بنویسید؟ تغییر به", "Off": "خاموش", "Okay, Let's Go!": "Okay, Let's Go!", "Ollama API URL": "Ollama API URL", "Ollama Version": "نسخه Ollama", + "Only alphanumeric characters and hyphens are allowed in the command string.": "فقط کاراکترهای الفبایی و خط فاصله در رشته فرمان مجاز هستند.", "On": "روشن", + "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.": "اوه! فایل های شما هنوز در فر پردازش هستند. ما آنها را کامل می پزیم. لطفا صبور باشید، به محض آماده شدن به شما اطلاع خواهیم داد.", "OpenAI API": "OpenAI API", "Open AI": "Open AI", - "Open new chat": "Open new chat", + "Open new chat": "باز کردن گپ جدید", "or": "روشن", "Parameters": "پارامترها", "Password": "رمز عبور", "Pending": "Pending", + "Permission denied when accessing microphone: {{error}}": "Permission denied when accessing microphone: {{error}}", "Profile": "پروفایل", "Prompt Content": "محتویات درخواست", "Prompts": "درخواست‌ها", @@ -195,9 +204,10 @@ "Set Title Auto-Generation Model": "Set Title Auto-Generation Model", "Set Voice": "Set Voice", "Share to OpenWebUI Community": "Share to OpenWebUI Community", - "Show shortcuts": "Show shortcuts", + "Show shortcuts": "نمایش میانبرها", "Sign Out": "خروج", "SpeechRecognition API is not supported in this browser.": "SpeechRecognition API is not supported in this browser.", + "Speech recognition error: {{error}}": "Speech recognition error: {{error}}", "Speech-to-Text Engine": "Speech-to-Text Engine", "Stop Sequence": "Stop Sequence", "STT Settings": "STT Settings", @@ -212,28 +222,28 @@ "Text-to-Speech Engine": "Text-to-Speech Engine", "Tfs Z": "Tfs Z", "Theme": "قالب", - "This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "This ensures that your valuable conversations are securely saved to your backend database. Thank you!", - "Title Auto-Generation": "Title Auto-Generation", - "Title Generation Prompt": "Title Generation Prompt", + "This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "این تضمین می کند که مکالمات ارزشمند شما به طور ایمن در پایگاه داده بکند ذخیره می شود. تشکر!", + "Title Auto-Generation": "تولید خودکار عنوان", + "Title Generation Prompt": "درخواست تولید عنوان", "Title": "عنوان", - "To access the available model names for downloading,": "To access the available model names for downloading,", + "To access the available model names for downloading,": "برای دسترسی به نام مدل های موجود برای دانلود،", "Toggle settings": "Toggle settings", "Toggle sidebar": "Toggle sidebar", "Top K": "Top K", "Top P": "Top P", - "TTS Settings": "TTS Settings", - "Uh-oh! There was an issue connecting to llama.": "Uh-oh! There was an issue connecting to llama.", - "Upload a GGUF model": "Upload a GGUF model", - "Upload files": "Upload files", - "Upload Progress": "Upload Progress", + "TTS Settings": "تنظیمات TTS", + "Uh-oh! There was an issue connecting to {{provider}}.": "اوه اوه! مشکلی در اتصال به {{provider}} وجود داشت.", + "Upload a GGUF model": "بارگذاری یک مدل GGUF", + "Upload files": "بارگذاری فایل‌ها", + "Upload Progress": "میزان پیشرفت بارگذاری", "URL Mode": "URL Mode", - "User Permissions": "User Permissions", + "User Permissions": "مجوزهای کاربر", "Users": "کاربران", "User": "کاربر", "WebUI Add-ons": "WebUI Add-ons", "{{webui_name}} Backend Required": "{{webui_name}} Backend Required", - "WebUI Settings": "WebUI Settings", - "Web": "Web", + "WebUI Settings": "تنظیمات WebUI", + "Web": "وب", "Whisper (Local)": "Whisper (Local)", "You're now logged in.": "شما اکنون وارد شده‌اید." } diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 037548fa..cfbdc596 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -241,7 +241,7 @@ location.href = '/'; }} > - Check Again + {$i18n.t('Check Again')}