mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 05:25:13 +00:00
10 lines
268 B
TypeScript
10 lines
268 B
TypeScript
|
export const getAntdLocale = (lang) => {
|
||
|
const lng = lang.replace('-', '_');
|
||
|
try {
|
||
|
require.resolve(`antd/lib/locale/${lng}`);
|
||
|
return require(`antd/lib/locale/${lng}`).default;
|
||
|
} catch (error) {
|
||
|
return require(`antd/lib/locale/en_US`).default;
|
||
|
}
|
||
|
};
|