From 82ed9b0a9708ec64f1cfa7ed7251a1a77e40151b Mon Sep 17 00:00:00 2001 From: silentoplayz Date: Wed, 13 Aug 2025 20:15:16 -0400 Subject: [PATCH] i18n.t: updates --- src/lib/apis/index.ts | 2 +- src/lib/components/AddConnectionModal.svelte | 8 +-- src/lib/components/AddServerModal.svelte | 4 +- src/lib/components/admin/Functions.svelte | 4 +- .../components/admin/Settings/Audio.svelte | 30 +++++----- .../components/admin/Settings/Database.svelte | 2 +- .../admin/Settings/Documents.svelte | 6 +- .../admin/Settings/Evaluations.svelte | 2 +- .../Evaluations/ArenaModelModal.svelte | 4 +- .../components/admin/Settings/General.svelte | 4 +- .../components/admin/Settings/Images.svelte | 12 ++-- .../Models/Manage/ManageOllama.svelte | 2 +- .../admin/Settings/Pipelines.svelte | 10 ++-- .../admin/Settings/WebSearch.svelte | 16 ++--- .../admin/Users/Groups/Permissions.svelte | 2 +- .../admin/Users/UserList/AddUserModal.svelte | 2 +- .../Messages/Message/ReactionPicker.svelte | 2 +- .../ContentRenderer/FloatingButtons.svelte | 6 +- .../components/chat/Controls/Valves.svelte | 2 +- .../MessageInput/InputVariablesModal.svelte | 8 +-- .../chat/ModelSelector/Selector.svelte | 4 +- .../Settings/Account/UpdatePassword.svelte | 2 +- src/lib/components/chat/Settings/Audio.svelte | 10 ++-- .../components/chat/Settings/General.svelte | 4 +- .../components/chat/Settings/Interface.svelte | 4 +- src/lib/components/common/Selector.svelte | 4 +- src/lib/components/common/Valves.svelte | 4 +- .../layout/Sidebar/ChannelItem.svelte | 2 +- .../layout/Sidebar/ChannelModal.svelte | 2 +- .../workspace/Knowledge/KnowledgeBase.svelte | 13 ++-- .../workspace/Models/ModelEditor.svelte | 2 +- .../workspace/common/ValvesModal.svelte | 2 +- src/lib/i18n/locales/ar-BH/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ar/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/bg-BG/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/bn-BD/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/bo-TB/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ca-ES/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ceb-PH/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/cs-CZ/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/da-DK/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/de-DE/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/dg-DG/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/el-GR/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/en-GB/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/en-US/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/es-ES/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/et-EE/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/eu-ES/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/fa-IR/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/fi-FI/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/fr-CA/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/fr-FR/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/gl-ES/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/he-IL/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/hi-IN/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/hr-HR/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/hu-HU/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/id-ID/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ie-GA/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/it-IT/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ja-JP/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ka-GE/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/kab-DZ/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ko-KR/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/lt-LT/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ms-MY/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/nb-NO/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/nl-NL/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/pa-IN/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/pl-PL/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/pt-BR/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/pt-PT/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ro-RO/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ru-RU/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/sk-SK/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/sr-RS/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/sv-SE/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/th-TH/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/tk-TM/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/tr-TR/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ug-CN/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/uk-UA/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/ur-PK/translation.json | 60 +++++++++++++++++++ .../i18n/locales/uz-Cyrl-UZ/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/vi-VN/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/zh-CN/translation.json | 60 +++++++++++++++++++ src/lib/i18n/locales/zh-TW/translation.json | 60 +++++++++++++++++++ .../workspace/models/create/+page.svelte | 4 +- 89 files changed, 3454 insertions(+), 91 deletions(-) diff --git a/src/lib/apis/index.ts b/src/lib/apis/index.ts index c3701b7325..4670052459 100644 --- a/src/lib/apis/index.ts +++ b/src/lib/apis/index.ts @@ -360,7 +360,7 @@ export const getToolServersData = async (i18n, servers: object[]) => { : `${server?.url}${(server?.path ?? '').startsWith('/') ? '' : '/'}${server?.path}` ).catch((err) => { toast.error( - i18n.t(`Failed to connect to {{URL}} OpenAPI tool server`, { + $i18n.t(`Failed to connect to {{URL}} OpenAPI tool server`, { URL: (server?.path ?? '').includes('://') ? server?.path : `${server?.url}${(server?.path ?? '').startsWith('/') ? '' : '/'}${server?.path}` diff --git a/src/lib/components/AddConnectionModal.svelte b/src/lib/components/AddConnectionModal.svelte index b62c6e4d16..2439c71ba7 100644 --- a/src/lib/components/AddConnectionModal.svelte +++ b/src/lib/components/AddConnectionModal.svelte @@ -108,7 +108,7 @@ if (!ollama && !url) { loading = false; - toast.error('URL is required'); + toast.error($i18n.t('URL is required')); return; } @@ -116,20 +116,20 @@ if (!apiVersion) { loading = false; - toast.error('API Version is required'); + toast.error($i18n.t('API Version is required')); return; } if (!key) { loading = false; - toast.error('Key is required'); + toast.error($i18n.t('Key is required')); return; } if (modelIds.length === 0) { loading = false; - toast.error('Deployment names are required'); + toast.error($i18n.t('Deployment names are required for Azure OpenAI')); return; } } diff --git a/src/lib/components/AddServerModal.svelte b/src/lib/components/AddServerModal.svelte index acec5c4add..0a5819beae 100644 --- a/src/lib/components/AddServerModal.svelte +++ b/src/lib/components/AddServerModal.svelte @@ -278,8 +278,8 @@ class={`w-full text-sm bg-transparent pr-5 ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`} bind:value={auth_type} > - - + + diff --git a/src/lib/components/admin/Functions.svelte b/src/lib/components/admin/Functions.svelte index 757dd80056..815a0a2ace 100644 --- a/src/lib/components/admin/Functions.svelte +++ b/src/lib/components/admin/Functions.svelte @@ -105,7 +105,7 @@ sessionStorage.function = JSON.stringify({ ..._function, id: `${_function.id}_clone`, - name: `${_function.name} (Clone)` + name: `${_function.name} (${$i18n.t('Clone')})` }); goto('/admin/functions/create'); } @@ -655,7 +655,7 @@ >
-
Please carefully review the following warnings:
+
{$i18n.t('Please carefully review the following warnings:')}
  • {$i18n.t('Functions allow arbitrary code execution.')}
  • diff --git a/src/lib/components/admin/Settings/Audio.svelte b/src/lib/components/admin/Settings/Audio.svelte index 3b465e7c76..10c8a6adb2 100644 --- a/src/lib/components/admin/Settings/Audio.svelte +++ b/src/lib/components/admin/Settings/Audio.svelte @@ -215,13 +215,13 @@
@@ -250,7 +250,7 @@ list="model-list" class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden" bind:value={STT_MODEL} - placeholder="Select a model" + placeholder={$i18n.t('Select a model')} /> @@ -275,7 +275,7 @@ @@ -424,7 +424,7 @@ {#each Object.values(TTS_RESPONSE_SPLIT) as split} diff --git a/src/lib/components/admin/Settings/Database.svelte b/src/lib/components/admin/Settings/Database.svelte index b2ac5553de..9c0d148fe6 100644 --- a/src/lib/components/admin/Settings/Database.svelte +++ b/src/lib/components/admin/Settings/Database.svelte @@ -76,7 +76,7 @@ ); if (res) { - toast.success('Config imported successfully'); + toast.success($i18n.t('Config imported successfully')); } e.target.value = null; }; diff --git a/src/lib/components/admin/Settings/Documents.svelte b/src/lib/components/admin/Settings/Documents.svelte index 9600f1d1a8..a819a4d0d8 100644 --- a/src/lib/components/admin/Settings/Documents.svelte +++ b/src/lib/components/admin/Settings/Documents.svelte @@ -746,7 +746,7 @@ @@ -947,7 +947,7 @@ @@ -587,7 +587,7 @@
-
Validate certificate
+
{$i18n.t('Validate certificate')}
diff --git a/src/lib/components/admin/Settings/Images.svelte b/src/lib/components/admin/Settings/Images.svelte index bc53678b83..0f0cbfe78d 100644 --- a/src/lib/components/admin/Settings/Images.svelte +++ b/src/lib/components/admin/Settings/Images.svelte @@ -143,7 +143,7 @@ if (config?.comfyui?.COMFYUI_WORKFLOW) { if (!validateJSON(config.comfyui.COMFYUI_WORKFLOW)) { - toast.error('Invalid JSON format for ComfyUI Workflow.'); + toast.error($i18n.t('Invalid JSON format for ComfyUI Workflow.')); loading = false; return; } @@ -566,10 +566,10 @@
- + @@ -578,12 +578,12 @@
@@ -650,7 +650,7 @@ list="model-list" class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden" bind:value={imageGenerationConfig.MODEL} - placeholder="Select a model" + placeholder={$i18n.t('Select a model')} required /> diff --git a/src/lib/components/admin/Settings/Models/Manage/ManageOllama.svelte b/src/lib/components/admin/Settings/Models/Manage/ManageOllama.svelte index 23315fdb12..6110cc2c7d 100644 --- a/src/lib/components/admin/Settings/Models/Manage/ManageOllama.svelte +++ b/src/lib/components/admin/Settings/Models/Manage/ManageOllama.svelte @@ -437,7 +437,7 @@ ...$MODEL_DOWNLOAD_POOL }); await deleteModel(localStorage.token, model); - toast.success(`${model} download has been canceled`); + toast.success($i18n.t("{{model}} download has been canceled", { model: model })); } }; diff --git a/src/lib/components/admin/Settings/Pipelines.svelte b/src/lib/components/admin/Settings/Pipelines.svelte index 635a83df5e..47294f1fa8 100644 --- a/src/lib/components/admin/Settings/Pipelines.svelte +++ b/src/lib/components/admin/Settings/Pipelines.svelte @@ -152,7 +152,7 @@ const res = await uploadPipeline(localStorage.token, file, selectedPipelinesUrlIdx).catch( (error) => { console.error(error); - toast.error('Something went wrong :/'); + toast.error($i18n.t('Something went wrong :/')); return null; } ); @@ -514,7 +514,9 @@ {:else if (valves_spec.properties[property]?.type ?? null) === 'boolean'}
- {valves[property] ? 'Enabled' : 'Disabled'} + {valves[property] + ? $i18n.t('Enabled') + : $i18n.t('Disabled')}
@@ -540,12 +542,12 @@ {/if} {:else} -
No valves
+
{$i18n.t('No valves')}
{/if}
{:else if pipelines.length === 0} -
Pipelines Not Detected
+
{$i18n.t('Pipelines Not Detected')}
{/if} {:else}
diff --git a/src/lib/components/admin/Settings/WebSearch.svelte b/src/lib/components/admin/Settings/WebSearch.svelte index 6a2959e028..599878345b 100644 --- a/src/lib/components/admin/Settings/WebSearch.svelte +++ b/src/lib/components/admin/Settings/WebSearch.svelte @@ -475,11 +475,11 @@ /> - - - - - + + + + +
@@ -493,9 +493,9 @@ class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden" bind:value={webConfig.PERPLEXITY_SEARCH_CONTEXT_USAGE} > - - - + + +
diff --git a/src/lib/components/admin/Users/Groups/Permissions.svelte b/src/lib/components/admin/Users/Groups/Permissions.svelte index fafff46c17..143d20bc30 100644 --- a/src/lib/components/admin/Users/Groups/Permissions.svelte +++ b/src/lib/components/admin/Users/Groups/Permissions.svelte @@ -158,7 +158,7 @@ diff --git a/src/lib/components/chat/ContentRenderer/FloatingButtons.svelte b/src/lib/components/chat/ContentRenderer/FloatingButtons.svelte index 1bb63515f0..389e17adc0 100644 --- a/src/lib/components/chat/ContentRenderer/FloatingButtons.svelte +++ b/src/lib/components/chat/ContentRenderer/FloatingButtons.svelte @@ -68,7 +68,7 @@ const actionHandler = async (actionId) => { if (!model) { - toast.error('Model not selected'); + toast.error($i18n.t('Model not selected')); return; } @@ -79,7 +79,7 @@ let selectedAction = actions.find((action) => action.id === actionId); if (!selectedAction) { - toast.error('Action not found'); + toast.error($i18n.t('Action not found')); return; } @@ -195,7 +195,7 @@ } } } else { - toast.error('An error occurred while fetching the explanation'); + toast.error($i18n.t('An error occurred while fetching the explanation')); } }; diff --git a/src/lib/components/chat/Controls/Valves.svelte b/src/lib/components/chat/Controls/Valves.svelte index 63d190e698..8a2f444fc0 100644 --- a/src/lib/components/chat/Controls/Valves.svelte +++ b/src/lib/components/chat/Controls/Valves.svelte @@ -150,7 +150,7 @@ @@ -261,7 +261,7 @@ { diff --git a/src/lib/components/layout/Sidebar/ChannelItem.svelte b/src/lib/components/layout/Sidebar/ChannelItem.svelte index a28433303a..26356a5534 100644 --- a/src/lib/components/layout/Sidebar/ChannelItem.svelte +++ b/src/lib/components/layout/Sidebar/ChannelItem.svelte @@ -34,7 +34,7 @@ }); if (res) { - toast.success('Channel updated successfully'); + toast.success($i18n.t('Channel updated successfully')); } onUpdate(); diff --git a/src/lib/components/layout/Sidebar/ChannelModal.svelte b/src/lib/components/layout/Sidebar/ChannelModal.svelte index abcc091ced..e59b3e42cc 100644 --- a/src/lib/components/layout/Sidebar/ChannelModal.svelte +++ b/src/lib/components/layout/Sidebar/ChannelModal.svelte @@ -58,7 +58,7 @@ }); if (res) { - toast.success('Channel deleted successfully'); + toast.success($i18n.t('Channel deleted successfully')); onUpdate(); if ($page.url.pathname === `/channels/${channel.id}`) { diff --git a/src/lib/components/workspace/Knowledge/KnowledgeBase.svelte b/src/lib/components/workspace/Knowledge/KnowledgeBase.svelte index 01de08a333..3e42ce1cb0 100644 --- a/src/lib/components/workspace/Knowledge/KnowledgeBase.svelte +++ b/src/lib/components/workspace/Knowledge/KnowledgeBase.svelte @@ -230,7 +230,7 @@ // Function to update the UI with the progress const updateProgress = () => { const percentage = (uploadedFiles / totalFiles) * 100; - toast.info(`Upload Progress: ${uploadedFiles}/${totalFiles} (${percentage.toFixed(2)}%)`); + toast.info($i18n.t("Upload Progress: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)", { uploadedFiles: uploadedFiles, totalFiles: totalFiles, percentage: percentage.toFixed(2) })); }; // Recursive function to count all files excluding hidden ones @@ -314,7 +314,8 @@ const updateProgress = () => { const percentage = (uploadedFiles / totalFiles) * 100; toast.info( - `Upload Progress: ${uploadedFiles}/${totalFiles} (${percentage.toFixed(2)}%)` + $i18n.t("Upload Progress: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)", + { uploadedFiles: uploadedFiles, totalFiles: totalFiles, percentage: percentage.toFixed(2) }) ); }; @@ -354,9 +355,9 @@ // Error handler const handleUploadError = (error) => { if (error.name === 'AbortError') { - toast.info('Directory selection was cancelled'); + toast.info($i18n.t('Directory selection was cancelled')); } else { - toast.error('Error accessing directory'); + toast.error($i18n.t('Error accessing directory')); console.error('Directory access error:', error); } }; @@ -692,7 +693,7 @@ type="text" class="text-left w-full font-semibold text-2xl font-primary bg-transparent outline-hidden" bind:value={knowledge.name} - placeholder="Knowledge Name" + placeholder={$i18n.t('Knowledge Name')} on:input={() => { changeDebounceHandler(); }} @@ -721,7 +722,7 @@ type="text" class="text-left text-xs w-full text-gray-500 bg-transparent outline-hidden" bind:value={knowledge.description} - placeholder="Knowledge Description" + placeholder={$i18n.t('Knowledge Description')} on:input={() => { changeDebounceHandler(); }} diff --git a/src/lib/components/workspace/Models/ModelEditor.svelte b/src/lib/components/workspace/Models/ModelEditor.svelte index 3e90e5af94..4547afabfd 100644 --- a/src/lib/components/workspace/Models/ModelEditor.svelte +++ b/src/lib/components/workspace/Models/ModelEditor.svelte @@ -489,7 +489,7 @@