Map zh -> zh-cn, tw -> zh-tw, cn -> zh-cn (#580)

This commit is contained in:
dangered wolf 2024-01-02 19:32:27 -05:00
parent a03995a959
commit 147ea4aadd
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58

View file

@ -29,8 +29,15 @@ export const translateStatus = async (
let translationApiResponse;
let translationResults: TranslationPartial;
/* Fix up some language codes that may be mistakenly used */
/* Clean up language codes so we can use them with Twitter API */
switch (language) {
case 'zh':
case 'cn':
language = 'zh-cn';
break;
case 'tw':
language = 'zh-tw';
break;
case 'jp':
language = 'ja';
break;