mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-04-06 19:10:54 +01:00
Added source_lang_en
This commit is contained in:
parent
811f1133a4
commit
bd196b05cb
3 changed files with 4 additions and 2 deletions
|
@ -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 || '',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
1
src/types.d.ts
vendored
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue