From 30722190852de0df5749153edff5f504e6331843 Mon Sep 17 00:00:00 2001 From: dingedi Date: Sat, 1 Oct 2022 17:34:17 +0200 Subject: [PATCH] better display of detected language --- app/static/js/app.js | 2 +- app/templates/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/static/js/app.js b/app/static/js/app.js index e2bd42f..e5974ea 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -228,7 +228,7 @@ document.addEventListener('DOMContentLoaded', function(){ self.loadingTranslation = false; self.output = JSON.stringify(res, null, 4); if(self.sourceLang == "auto" && res.detectedLanguage !== undefined){ - self.detectedLangText = res.detectedLanguage.language+" ("+res.detectedLanguage.confidence+"%)"; + self.detectedLangText = ": " + self.langs.find(l => l.code === res.detectedLanguage.language).name+" ("+res.detectedLanguage.confidence+"%)"; } } else{ throw new Error(res.error || "Unknown error"); diff --git a/app/templates/index.html b/app/templates/index.html index 454c49f..e9068ea 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -142,7 +142,7 @@
Translate from - [[ detectedLangText ]] + [[ detectedLangText ]]