LibreTranslate URL Example

This commit is contained in:
Bahamut 2023-09-05 23:30:58 +03:00
parent 56b78a8227
commit fe64597a23
1 changed files with 3 additions and 2 deletions

View File

@ -199,7 +199,6 @@ async function translateProviderLibre(text, lang) {
throw new Error(response.statusText);
}
async function translateProviderGoogle(text, lang) {
const response = await fetch('/google_translate', {
method: 'POST',
@ -447,7 +446,9 @@ jQuery(() => {
});
$('#translate_url_button').on('click', async () => {
const optionText = $('#translation_provider option:selected').text();
const url = await callPopup(`<h3>${optionText} API URL</h3>`, 'input');
const exampleURLs = {};
exampleURLs['libre'] = 'http://127.0.0.1:5000/translate';
const url = await callPopup(`<h3>${optionText} API URL</h3><i>Example: <tt>` + exampleURLs[extension_settings.translate.provider] + `</tt></i>`, 'input');
if (url == false) {
return;