mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
8 lines
231 B
TypeScript
8 lines
231 B
TypeScript
export const convertLanguageCodeToLocale = (codename: string): Locale => {
|
|
if (codename === "zh-TW" || codename === "zh-HK") {
|
|
return "hant";
|
|
}
|
|
const shortCode = codename.substring(0, 2);
|
|
return shortCode as Locale;
|
|
};
|