Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/zuiidea/antd-admin into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
zuiidea committed Jul 6, 2019
2 parents 65a4535 + 5daa2a9 commit 5e148fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/layouts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5e148fe

Please sign in to comment.