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