api/language-codes: remove region part of the language code
and convert language codes if they're not 3 characters long
This commit is contained in:
@@ -49,5 +49,6 @@ const maps = {
|
||||
}
|
||||
|
||||
export const convertLanguageCode = (code) => {
|
||||
code = code.split("-")[0].split("_")[0];
|
||||
return maps[code.length]?.[code.toLowerCase()] || null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user