mirror of https://github.com/usememos/memos
feat: automatically change language on first launch (#1278)
* feat: automatically change language to browser language on first launch(#1238) * Update web/src/store/module/global.ts * chroe: rename languageCodeCovert to convertLanguageCodeToLocale --------- Co-authored-by: boojack <stevenlgtm@gmail.com>pull/1288/head
parent
8c5ba63f8c
commit
ddf1eb0219
@ -0,0 +1,7 @@
|
||||
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;
|
||||
};
|
Loading…
Reference in New Issue