From a03995a9595ddcbad262541c2a7b943047f72dc9 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Tue, 2 Jan 2024 19:28:39 -0500 Subject: [PATCH] Accept extended language codes (#580) --- src/providers/twitter/processor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/twitter/processor.ts b/src/providers/twitter/processor.ts index 97c7f5d..f2cded2 100644 --- a/src/providers/twitter/processor.ts +++ b/src/providers/twitter/processor.ts @@ -261,7 +261,7 @@ export const buildAPITwitterStatus = async ( 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 !== status.legacy.lang) { + if (typeof language === 'string' && (language.length === 2 || language.length === 5) && language !== status.legacy.lang) { console.log(`Attempting to translate status to ${language}...`); const translateAPI = await translateStatus(status, '', language, c); if (translateAPI !== null && translateAPI?.translation) {