From bd196b05cbb70d396481c65719c7cd41b7130508 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Sun, 7 Aug 2022 18:48:59 -0400 Subject: [PATCH] Added source_lang_en --- src/api.ts | 3 ++- src/status.ts | 2 +- src/types.d.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api.ts b/src/api.ts index 0b8eeee..98bea6e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -133,7 +133,8 @@ const populateTweetProperties = async ( apiTweet.translation = { text: unescapeText(linkFixer(tweet, translateAPI?.translation || '')), source_lang: translateAPI?.sourceLanguage || '', - target_lang: translateAPI?.destinationLanguage || '' + target_lang: translateAPI?.destinationLanguage || '', + source_lang_en: translateAPI?.localizedSourceLanguage || '', }; } } diff --git a/src/status.ts b/src/status.ts index c995c7b..19abdd8 100644 --- a/src/status.ts +++ b/src/status.ts @@ -85,7 +85,7 @@ export const handleStatus = async ( const formatText = language === 'en' ? Strings.TRANSLATE_TEXT.format({ - language: translation.source_lang + language: translation.source_lang_en }) : Strings.TRANSLATE_TEXT_INTL.format({ source: translation.source_lang.toUpperCase(), diff --git a/src/types.d.ts b/src/types.d.ts index f53e36d..d0a3d32 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -45,6 +45,7 @@ interface APIResponse { interface APITranslate { text: string; source_lang: string; + source_lang_en: string; target_lang: string; }