From fe64597a237cb114bcb456da618e4aa9f8eb56e8 Mon Sep 17 00:00:00 2001 From: Bahamut Date: Tue, 5 Sep 2023 23:30:58 +0300 Subject: [PATCH] LibreTranslate URL Example --- public/scripts/extensions/translate/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/scripts/extensions/translate/index.js b/public/scripts/extensions/translate/index.js index 2be6cf45f..488ab2071 100644 --- a/public/scripts/extensions/translate/index.js +++ b/public/scripts/extensions/translate/index.js @@ -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(`

${optionText} API URL

`, 'input'); + const exampleURLs = {}; + exampleURLs['libre'] = 'http://127.0.0.1:5000/translate'; + const url = await callPopup(`

${optionText} API URL

Example: ` + exampleURLs[extension_settings.translate.provider] + ``, 'input'); if (url == false) { return;