i18n.t: updates

This commit is contained in:
silentoplayz
2025-08-13 20:15:16 -04:00
parent b43acc2b3d
commit 82ed9b0a97
89 changed files with 3454 additions and 91 deletions
+2 -2
View File
@@ -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 @@
>
<div class="text-sm text-gray-500">
<div class=" bg-yellow-500/20 text-yellow-700 dark:text-yellow-200 rounded-lg px-4 py-3">
<div>Please carefully review the following warnings:</div>
<div>{$i18n.t('Please carefully review the following warnings:')}</div>
<ul class=" mt-1 list-disc pl-4 text-xs">
<li>{$i18n.t('Functions allow arbitrary code execution.')}</li>
+15 -15
View File
@@ -215,13 +215,13 @@
<select
class="dark:bg-gray-900 cursor-pointer w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"
bind:value={STT_ENGINE}
placeholder="Select an engine"
placeholder={$i18n.t('Select an engine')}
>
<option value="">{$i18n.t('Whisper (Local)')}</option>
<option value="openai">OpenAI</option>
<option value="openai">{$i18n.t('OpenAI')}</option>
<option value="web">{$i18n.t('Web API')}</option>
<option value="deepgram">Deepgram</option>
<option value="azure">Azure AI Speech</option>
<option value="deepgram">{$i18n.t('Deepgram')}</option>
<option value="azure">{$i18n.t('Azure AI Speech')}</option>
</select>
</div>
</div>
@@ -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')}
/>
<datalist id="model-list">
@@ -275,7 +275,7 @@
<input
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 (optional)"
placeholder={$i18n.t('Select a model (optional)')}
/>
</div>
</div>
@@ -424,7 +424,7 @@
<select
class=" dark:bg-gray-900 w-fit pr-8 cursor-pointer rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"
bind:value={TTS_ENGINE}
placeholder="Select a mode"
placeholder={$i18n.t('Select a mode')}
on:change={async (e) => {
await updateConfigHandler();
await getVoices();
@@ -539,7 +539,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={TTS_MODEL}
placeholder="CMU ARCTIC speaker embedding name"
placeholder={$i18n.t('CMU ARCTIC speaker embedding name')}
/>
<datalist id="model-list">
@@ -581,7 +581,7 @@
list="voice-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={TTS_VOICE}
placeholder="Select a voice"
placeholder={$i18n.t('Select a voice')}
/>
<datalist id="voice-list">
@@ -600,7 +600,7 @@
list="tts-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={TTS_MODEL}
placeholder="Select a model"
placeholder={$i18n.t('Select a model')}
/>
<datalist id="tts-model-list">
@@ -622,7 +622,7 @@
list="voice-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={TTS_VOICE}
placeholder="Select a voice"
placeholder={$i18n.t('Select a voice')}
/>
<datalist id="voice-list">
@@ -641,7 +641,7 @@
list="tts-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={TTS_MODEL}
placeholder="Select a model"
placeholder={$i18n.t('Select a model')}
/>
<datalist id="tts-model-list">
@@ -663,7 +663,7 @@
list="voice-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={TTS_VOICE}
placeholder="Select a voice"
placeholder={$i18n.t('Select a voice')}
/>
<datalist id="voice-list">
@@ -690,7 +690,7 @@
list="tts-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={TTS_AZURE_SPEECH_OUTPUT_FORMAT}
placeholder="Select a output format"
placeholder={$i18n.t('Select an output format')}
/>
</div>
</div>
@@ -704,7 +704,7 @@
<div class="flex items-center relative">
<select
class="dark:bg-gray-900 w-fit pr-8 cursor-pointer rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"
aria-label="Select how to split message text for TTS requests"
aria-label={$i18n.t('Select how to split message text for TTS requests')}
bind:value={TTS_SPLIT_ON}
>
{#each Object.values(TTS_RESPONSE_SPLIT) as split}
@@ -76,7 +76,7 @@
);
if (res) {
toast.success('Config imported successfully');
toast.success($i18n.t('Config imported successfully'));
}
e.target.value = null;
};
@@ -746,7 +746,7 @@
<select
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"
bind:value={embeddingEngine}
placeholder="Select an embedding model engine"
placeholder={$i18n.t('Select an embedding model engine')}
on:change={(e) => {
if (e.target.value === 'ollama') {
embeddingModel = '';
@@ -811,7 +811,7 @@
<div class="flex gap-2">
<input
class="flex-1 w-full text-sm bg-transparent outline-hidden"
placeholder="Version"
placeholder={$i18n.t('Version')}
bind:value={AzureOpenAIVersion}
required
/>
@@ -947,7 +947,7 @@
<select
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"
bind:value={RAGConfig.RAG_RERANKING_ENGINE}
placeholder="Select a reranking model engine"
placeholder={$i18n.t('Select a reranking model engine')}
on:change={(e) => {
if (e.target.value === 'external') {
RAGConfig.RAG_RERANKING_MODEL = '';
@@ -26,7 +26,7 @@
});
if (evaluationConfig) {
toast.success('Settings saved successfully');
toast.success($i18n.t('Settings saved successfully!'));
models.set(
await getModels(
localStorage.token,
@@ -62,7 +62,7 @@
if (!name || !id) {
loading = false;
toast.error('Name and ID are required, please fill them out');
toast.error($i18n.t('Name and ID are required, please fill them out'));
return;
}
@@ -70,7 +70,7 @@
if ($models.find((model) => model.name === name)) {
loading = false;
name = '';
toast.error('Model name already exists, please choose a different one');
toast.error($i18n.t('Model name already exists, please choose a different one'));
return;
}
}
@@ -290,7 +290,7 @@
<select
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
bind:value={adminConfig.DEFAULT_USER_ROLE}
placeholder="Select a role"
placeholder={$i18n.t('Select a role')}
>
<option value="pending">{$i18n.t('pending')}</option>
<option value="user">{$i18n.t('user')}</option>
@@ -587,7 +587,7 @@
</div>
</div>
<div class="flex justify-between items-center text-xs">
<div class=" font-medium">Validate certificate</div>
<div class=" font-medium">{$i18n.t('Validate certificate')}</div>
<div class="mt-1">
<Switch bind:state={LDAP_SERVER.validate_cert} />
@@ -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 @@
</div>
</div>
<div class="">
<Tooltip content="Input Key (e.g. text, unet_name, steps)">
<Tooltip content={$i18n.t('Input Key (e.g. text, unet_name, steps)')}>
<input
class="py-1 px-3 w-24 text-xs text-center bg-transparent outline-hidden border-r border-gray-50 dark:border-gray-850"
placeholder="Key"
placeholder={$i18n.t('Key')}
bind:value={node.key}
required
/>
@@ -578,12 +578,12 @@
<div class="w-full">
<Tooltip
content="Comma separated Node Ids (e.g. 1 or 1,2)"
content={$i18n.t('Comma separated Node Ids (e.g. 1 or 1,2)')}
placement="top-start"
>
<input
class="w-full py-1 px-4 text-xs bg-transparent outline-hidden"
placeholder="Node Ids"
placeholder={$i18n.t('Node Ids')}
bind:value={node.node_ids}
/>
</Tooltip>
@@ -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
/>
@@ -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 }));
}
};
@@ -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'}
<div class="flex justify-between items-center">
<div class="text-xs text-gray-500">
{valves[property] ? 'Enabled' : 'Disabled'}
{valves[property]
? $i18n.t('Enabled')
: $i18n.t('Disabled')}
</div>
<div class=" pr-2">
@@ -540,12 +542,12 @@
<Spinner className="size-5" />
{/if}
{:else}
<div>No valves</div>
<div>{$i18n.t('No valves')}</div>
{/if}
</div>
</div>
{:else if pipelines.length === 0}
<div>Pipelines Not Detected</div>
<div>{$i18n.t('Pipelines Not Detected')}</div>
{/if}
{:else}
<div class="flex justify-center">
@@ -475,11 +475,11 @@
/>
<datalist id="perplexity-model-list">
<option value="sonar">Sonar</option>
<option value="sonar-pro">Sonar Pro</option>
<option value="sonar-reasoning">Sonar Reasoning</option>
<option value="sonar-reasoning-pro">Sonar Reasoning Pro</option>
<option value="sonar-deep-research">Sonar Deep Research</option>
<option value="sonar">{$i18n.t('Sonar')}</option>
<option value="sonar-pro">{$i18n.t('Sonar Pro')}</option>
<option value="sonar-reasoning">{$i18n.t('Sonar Reasoning')}</option>
<option value="sonar-reasoning-pro">{$i18n.t('Sonar Reasoning Pro')}</option>
<option value="sonar-deep-research">{$i18n.t('Sonar Deep Research')}</option>
</datalist>
</div>
</div>
@@ -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}
>
<option value="low">Low</option>
<option value="medium">Medium</option>
<option value="high">High</option>
<option value="low">{$i18n.t('Low')}</option>
<option value="medium">{$i18n.t('Medium')}</option>
<option value="high">{$i18n.t('High')}</option>
</select>
</div>
</div>
@@ -158,7 +158,7 @@
<select
class="w-full bg-transparent outline-hidden py-0.5 text-sm"
bind:value={permissions.model.default_id}
placeholder="Select a model"
placeholder={$i18n.t('Select a model')}
>
<option value="" disabled selected>{$i18n.t('Select a model')}</option>
{#each permissions.model.filter ? $models.filter( (model) => filterModelIds.includes(model.id) ) : $models.filter((model) => model.id) as model}
@@ -104,7 +104,7 @@
}
}
toast.success(`Successfully imported ${userCount} users.`);
toast.success($i18n.t("Successfully imported {{userCount}} users.", { userCount: userCount }));
inputFiles = null;
const uploadInputElement = document.getElementById('upload-user-csv-input');