"vscode:/vscode.git/clone" did not exist on "01f98730489e50715bf5fab27e5db96273cabd01"
locale.ts 396 Bytes
Newer Older
dechen lin's avatar
dechen lin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export enum ELocal {
  "zh-CN" = "zh-CN",
  "en-US" = "en-US",
}
export const locale: { [key: string]: string } = {
  [ELocal["zh-CN"]]: "中文",
  [ELocal["en-US"]]: "En",
};
export const localeName: { [key: string]: string } = {
  [ELocal["zh-CN"]]: "nameZh",
  [ELocal["en-US"]]: "name",
};

export const getLocale = () => {
  return localStorage.getItem("umi_locale") || ELocal["zh-CN"];
};