fix: language flags
This commit is contained in:
parent
82fdd0f21c
commit
01261b6f3a
|
@ -45,7 +45,8 @@ const languageToFlagMap: Record<string, string> = {
|
|||
};
|
||||
|
||||
export function getFlagEmoji(languageCode?: string): string | undefined {
|
||||
const language = languageCode?.split("-").pop()?.toLowerCase();
|
||||
if (!language) return;
|
||||
return languageToFlagMap[language];
|
||||
if (!languageCode) return;
|
||||
const language = languageCode.split("-").shift()?.toLowerCase();
|
||||
if (language == null) return;
|
||||
return languageToFlagMap[language] ?? `[${language.toUpperCase()}]`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue