mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-14 13:00:49 +08:00
修复错误信息展示
This commit is contained in:
+7
-3
@@ -3,13 +3,17 @@ import intl from 'react-intl-universal';
|
||||
|
||||
export function rootContainer(container: any) {
|
||||
const locales = {
|
||||
'en-US': require('./locales/en-US.json'),
|
||||
'zh-CN': require('./locales/zh-CN.json'),
|
||||
'en': require('./locales/en-US.json'),
|
||||
'zh': require('./locales/zh-CN.json'),
|
||||
};
|
||||
let currentLocale = intl.determineLocale({
|
||||
urlLocaleKey: 'lang',
|
||||
cookieLocaleKey: 'lang',
|
||||
});
|
||||
}).slice(0, 2);
|
||||
|
||||
if (!currentLocale || !Object.keys(locales).includes(currentLocale)) {
|
||||
currentLocale = 'zh';
|
||||
}
|
||||
|
||||
intl.init({ currentLocale, locales });
|
||||
return container;
|
||||
|
||||
Reference in New Issue
Block a user