fix: add missed translations

This commit is contained in:
Ased Mammad 2024-03-03 13:31:34 +03:30
parent da0202851f
commit 6d2f462090
14 changed files with 126 additions and 76 deletions

View file

@ -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 {

View file

@ -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' })
);
}
}

View file

@ -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 = '';
});
}

View file

@ -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' }));
}
};

View file

@ -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 = '';

View file

@ -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;