mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-30 05:13:43 +00:00
Merge branch 'develop' of https://github.com/zuiidea/antd-admin into develop
This commit is contained in:
@@ -5,12 +5,14 @@ import { I18nProvider } from '@lingui/react'
|
||||
import { langFromPath, defaultLanguage } from 'utils'
|
||||
import zh_CN from 'antd/lib/locale-provider/zh_CN'
|
||||
import en_US from 'antd/lib/locale-provider/en_US'
|
||||
import pt_BR from 'antd/lib/locale-provider/pt_BR'
|
||||
|
||||
import BaseLayout from './BaseLayout'
|
||||
|
||||
const languages = {
|
||||
zh: zh_CN,
|
||||
en: en_US,
|
||||
'pt-br': pt_BR,
|
||||
}
|
||||
|
||||
@withRouter
|
||||
|
||||
@@ -2,6 +2,8 @@ import { cloneDeep, isString, flow, curry } from 'lodash'
|
||||
import umiRouter from 'umi/router'
|
||||
import pathToRegexp from 'path-to-regexp'
|
||||
import { i18n } from './config'
|
||||
import moment from 'moment'
|
||||
import 'moment/locale/zh-cn'
|
||||
|
||||
export classnames from 'classnames'
|
||||
export config from './config'
|
||||
@@ -245,6 +247,7 @@ export function getLocale() {
|
||||
|
||||
export function setLocale(language) {
|
||||
if (getLocale() !== language) {
|
||||
moment.locale(language === 'zh' ? 'zh-cn' : language)
|
||||
umiRouter.push({
|
||||
pathname: `/${language}${deLangPrefix(window.location.pathname)}`,
|
||||
search: window.location.search,
|
||||
|
||||
Reference in New Issue
Block a user