diff --git a/src/embed/status.ts b/src/embed/status.ts index 8922b20..7fae148 100644 --- a/src/embed/status.ts +++ b/src/embed/status.ts @@ -45,7 +45,7 @@ export const handleStatus = async ( status, fetchWithThreads, request, - undefined, + language, flags?.api ?? false ); diff --git a/src/providers/twitter/conversation.ts b/src/providers/twitter/conversation.ts index 3fa8956..87a9dfa 100644 --- a/src/providers/twitter/conversation.ts +++ b/src/providers/twitter/conversation.ts @@ -272,13 +272,16 @@ export const constructTwitterThread = async ( language: string | undefined, legacyAPI = false ): Promise<SocialThread> => { - console.log('legacyAPI', legacyAPI); + console.log('language', language); let response: TweetDetailResult | TweetResultsByRestIdResult | null = null; let post: APITweet; /* We can use TweetDetail on elongator accounts to increase per-account rate limit. - We also use TweetDetail to process threads (WIP) */ - if (typeof TwitterProxy !== 'undefined' && (experimentCheck(Experiment.TWEET_DETAIL_API) || processThread)) { + We also use TweetDetail to process threads (WIP) + + Also - dirty hack. Right now, TweetDetails requests aren't working with language and I haven't figured out why. + I'll figure out why eventually, but for now just don't use TweetDetail for this. */ + if (typeof TwitterProxy !== 'undefined' && !language && (experimentCheck(Experiment.TWEET_DETAIL_API) || processThread)) { console.log('Using TweetDetail for request...'); response = (await fetchTweetDetail(id, request.event)) as TweetDetailResult; diff --git a/src/providers/twitter/processor.ts b/src/providers/twitter/processor.ts index ff46146..c11b436 100644 --- a/src/providers/twitter/processor.ts +++ b/src/providers/twitter/processor.ts @@ -230,6 +230,8 @@ export const buildAPITweet = async ( apiTweet.embed_card = 'player'; } + console.log('language?', language) + /* If a language is specified in API or by user, let's try translating it! */ if (typeof language === 'string' && language.length === 2 && language !== tweet.legacy.lang) { console.log(`Attempting to translate Tweet to ${language}...`);