mirror of
https://github.com/zuiidea/antd-admin.git
synced 2024-04-21 12:32:14 +00:00
added pt-br and some improvements to language control
This commit is contained in:
+66
-11
@@ -6,14 +6,24 @@ const database = [
|
||||
id: '1',
|
||||
icon: 'dashboard',
|
||||
name: 'Dashboard',
|
||||
zhName: '仪表盘',
|
||||
zh: {
|
||||
name: '仪表盘'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Dashboard'
|
||||
},
|
||||
route: '/dashboard',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'Users',
|
||||
zhName: '用户管理',
|
||||
zh: {
|
||||
name: '用户管理'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Usuário'
|
||||
},
|
||||
icon: 'user',
|
||||
route: '/user',
|
||||
},
|
||||
@@ -21,7 +31,12 @@ const database = [
|
||||
id: '7',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'Posts',
|
||||
zhName: '文章管理',
|
||||
zh: {
|
||||
name: '用户管理'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Posts'
|
||||
},
|
||||
icon: 'shopping-cart',
|
||||
route: '/post',
|
||||
},
|
||||
@@ -30,14 +45,24 @@ const database = [
|
||||
menuParentId: '-1',
|
||||
breadcrumbParentId: '2',
|
||||
name: 'User Detail',
|
||||
zhName: '用户详情',
|
||||
zh: {
|
||||
name: '用户详情'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Detalhes do usuário'
|
||||
},
|
||||
route: '/user/:id',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'Request',
|
||||
zhName: 'Request',
|
||||
zh: {
|
||||
name: 'Request'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Requisição'
|
||||
},
|
||||
icon: 'api',
|
||||
route: '/request',
|
||||
},
|
||||
@@ -45,7 +70,12 @@ const database = [
|
||||
id: '4',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'UI Element',
|
||||
zhName: 'UI组件',
|
||||
zh: {
|
||||
name: 'UI组件'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Elementos UI'
|
||||
},
|
||||
icon: 'camera-o',
|
||||
},
|
||||
{
|
||||
@@ -53,7 +83,12 @@ const database = [
|
||||
breadcrumbParentId: '4',
|
||||
menuParentId: '4',
|
||||
name: 'Editor',
|
||||
zhName: 'Editor',
|
||||
zh: {
|
||||
name: 'Editor'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Editor'
|
||||
},
|
||||
icon: 'edit',
|
||||
route: '/UIElement/editor',
|
||||
},
|
||||
@@ -61,7 +96,12 @@ const database = [
|
||||
id: '5',
|
||||
breadcrumbParentId: '1',
|
||||
name: 'Charts',
|
||||
zhName: 'Charts',
|
||||
zh: {
|
||||
name: 'Charts'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Graficos'
|
||||
},
|
||||
icon: 'code-o',
|
||||
},
|
||||
{
|
||||
@@ -69,7 +109,12 @@ const database = [
|
||||
breadcrumbParentId: '5',
|
||||
menuParentId: '5',
|
||||
name: 'ECharts',
|
||||
zhName: 'ECharts',
|
||||
zh: {
|
||||
name: 'ECharts'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'ECharts'
|
||||
},
|
||||
icon: 'line-chart',
|
||||
route: '/chart/ECharts',
|
||||
},
|
||||
@@ -78,7 +123,12 @@ const database = [
|
||||
breadcrumbParentId: '5',
|
||||
menuParentId: '5',
|
||||
name: 'HighCharts',
|
||||
zhName: 'HighCharts',
|
||||
zh: {
|
||||
name: 'HighCharts'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'HighCharts'
|
||||
},
|
||||
icon: 'bar-chart',
|
||||
route: '/chart/highCharts',
|
||||
},
|
||||
@@ -87,7 +137,12 @@ const database = [
|
||||
breadcrumbParentId: '5',
|
||||
menuParentId: '5',
|
||||
name: 'Rechartst',
|
||||
zhName: 'Rechartst',
|
||||
zh: {
|
||||
name: 'Rechartst'
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Rechartst'
|
||||
},
|
||||
icon: 'area-chart',
|
||||
route: '/chart/Recharts',
|
||||
},
|
||||
|
||||
@@ -58,17 +58,20 @@ class PrimaryLayout extends PureComponent {
|
||||
const { onCollapseChange } = this
|
||||
|
||||
// Localized route name.
|
||||
|
||||
const lang = langFromPath(location.pathname);
|
||||
const newRouteList =
|
||||
langFromPath(location.pathname) === 'zh'
|
||||
lang !== 'en'
|
||||
? routeList.map(item => {
|
||||
const { zhName, ...other } = item
|
||||
const { name , ...other } = item
|
||||
return {
|
||||
...other,
|
||||
name: zhName,
|
||||
name: ((item[lang] || {}).name || name),
|
||||
}
|
||||
})
|
||||
: routeList
|
||||
|
||||
|
||||
// Find a route that matches the pathname.
|
||||
const currentRoute = newRouteList.find(
|
||||
_ => _.route && pathMatchRegexp(_.route, location.pathname)
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"/dashboard": "/dashboard",
|
||||
"Add Param": "Add Parametro",
|
||||
"Address": "Endereço",
|
||||
"Age": "Ano",
|
||||
"Are you sure delete this record?": "Tem certeza de excluir este registro?",
|
||||
"Author": "Autor",
|
||||
"Avatar": "Avatar",
|
||||
"Categories": "Categorias",
|
||||
"Clear notifications": "limpar notificações",
|
||||
"Comments": "Comentarios",
|
||||
"Create": "Criar",
|
||||
"Create User": "Criar Usuário",
|
||||
"CreateTime": "CreateTime",
|
||||
"Dark": "Escuro",
|
||||
"Delete": "Deletar",
|
||||
"Email": "Email",
|
||||
"Female": "Feminino",
|
||||
"Gender": "Genero",
|
||||
"Hi,": "Olá,",
|
||||
"Image": "Imagem",
|
||||
"Light": "Claro",
|
||||
"Male": "masculino",
|
||||
"Name": "Nome",
|
||||
"NickName": "NickName",
|
||||
"Not Found": "Não Encontrado",
|
||||
"Operation": "Operation",
|
||||
"Params": "Parametros",
|
||||
"Password": "Senha",
|
||||
"Phone": "Fone",
|
||||
"Pick an address": "Escolha um endereço",
|
||||
"Please pick an address": "Por favor, escolha um endereço",
|
||||
"Publised": "Publicado",
|
||||
"Publish Date": "Data de publicação",
|
||||
"Reset": "Reset",
|
||||
"Search": "procurar",
|
||||
"Search Name": "Search Name",
|
||||
"Send": "Enviar",
|
||||
"Sign in": "Sign in",
|
||||
"Sign out": "Sign out",
|
||||
"Switch Theme": "Trocar tema",
|
||||
"Tags": "Tags",
|
||||
"The input is not valid E-mail!": "Não é um E-mail valido!",
|
||||
"The input is not valid phone!": "Não é um telefone Valido!",
|
||||
"Title": "Titulo",
|
||||
"Total {total} Items": "Total {total} Items",
|
||||
"Unpublished": "Não publicado",
|
||||
"Update": "Atualizar",
|
||||
"Update User": "Atualizar Usuário",
|
||||
"Username": "Usuário",
|
||||
"Views": "visualizações",
|
||||
"Visibility": "Visibilidade",
|
||||
"You have viewed all notifications.": "Você visualizou todas as notificações."
|
||||
}
|
||||
+6
-1
@@ -18,6 +18,11 @@ module.exports = {
|
||||
i18n: {
|
||||
/* Countrys flags: https://www.flaticon.com/packs/countrys-flags */
|
||||
languages: [
|
||||
{
|
||||
key: 'pt-br',
|
||||
title: 'Português',
|
||||
flag: '/brazil.svg',
|
||||
},
|
||||
{
|
||||
key: 'en',
|
||||
title: 'English',
|
||||
@@ -29,6 +34,6 @@ module.exports = {
|
||||
flag: '/china.svg',
|
||||
},
|
||||
],
|
||||
defaultLanguage: 'en',
|
||||
defaultLanguage: 'pt-br',
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user