Added source_lang_en

This commit is contained in:
dangered wolf 2022-08-07 18:48:59 -04:00
parent 811f1133a4
commit bd196b05cb
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58
3 changed files with 4 additions and 2 deletions

View file

@ -133,7 +133,8 @@ const populateTweetProperties = async (
apiTweet.translation = { apiTweet.translation = {
text: unescapeText(linkFixer(tweet, translateAPI?.translation || '')), text: unescapeText(linkFixer(tweet, translateAPI?.translation || '')),
source_lang: translateAPI?.sourceLanguage || '', source_lang: translateAPI?.sourceLanguage || '',
target_lang: translateAPI?.destinationLanguage || '' target_lang: translateAPI?.destinationLanguage || '',
source_lang_en: translateAPI?.localizedSourceLanguage || '',
}; };
} }
} }

View file

@ -85,7 +85,7 @@ export const handleStatus = async (
const formatText = const formatText =
language === 'en' language === 'en'
? Strings.TRANSLATE_TEXT.format({ ? Strings.TRANSLATE_TEXT.format({
language: translation.source_lang language: translation.source_lang_en
}) })
: Strings.TRANSLATE_TEXT_INTL.format({ : Strings.TRANSLATE_TEXT_INTL.format({
source: translation.source_lang.toUpperCase(), source: translation.source_lang.toUpperCase(),

1
src/types.d.ts vendored
View file

@ -45,6 +45,7 @@ interface APIResponse {
interface APITranslate { interface APITranslate {
text: string; text: string;
source_lang: string; source_lang: string;
source_lang_en: string;
target_lang: string; target_lang: string;
} }