Skip to content
Permalink
Browse files

添加了一个国际化切换演示页面

  • Loading branch information...
FairyEver committed Aug 28, 2019
1 parent 71e1b6b commit fadef5b406d640c646f3ad8309196a822170165e
@@ -40,6 +40,51 @@
</translation>
</translations>
</concept_node>
<folder_node>
<name>page</name>
<children>
<folder_node>
<name>demo</name>
<children>
<folder_node>
<name>playground</name>
<children>
<folder_node>
<name>locales</name>
<children>
<concept_node>
<name>text</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>ja-JP</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CHS</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CHT</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children>
</folder_node>
</children>
</folder_node>
</children>
</folder_node>
</children>
</folder_node>
</children>
</folder_node>
<isTemplateProject>false</isTemplateProject>
@@ -8,8 +8,8 @@
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(language, index) in $languages"
:key="index"
v-for="language in $languages"
:key="language.value"
:command="language.value">
<d2-icon :name="$i18n.locale === language.value ? 'dot-circle-o' : 'circle-o'" class="d2-mr-5"/>
{{ language.label }}
@@ -1,3 +1,12 @@
{
"_name": "English"
"_name": "English",
"page": {
"demo": {
"playground": {
"locales": {
"text": "D2Admin is a fully open source and free enterprise back-end product front-end integration solution, using the latest front-end technology stack, has prepared most of the project preparations, and with a lot of sample code to help the management system agile development."
}
}
}
}
}
@@ -1,3 +1,12 @@
{
"_name": "日本語"
"_name": "日本語",
"page": {
"demo": {
"playground": {
"locales": {
"text": "D2Adminは、最新のフロントエンドテクノロジースタックを使用した、完全にオープンソースの無料エンタープライズバックエンド製品フロントエンド統合ソリューションであり、プロジェクトのほとんどの準備を整えており、システムのアジャイル開発の管理に役立つ多くのサンプルコードを備えています。"
}
}
}
}
}
@@ -1,3 +1,12 @@
{
"_name": "简体中文"
"_name": "简体中文",
"page": {
"demo": {
"playground": {
"locales": {
"text": "D2Admin 是一个完全 开源免费 的企业中后台产品前端集成方案,使用最新的前端技术栈,已经做好大部分项目前期准备工作,并且带有大量示例代码,助力管理系统敏捷开发。"
}
}
}
}
}
@@ -1,3 +1,12 @@
{
"_name": "繁體中文"
"_name": "繁體中文",
"page": {
"demo": {
"playground": {
"locales": {
"text": "D2Admin 是一個完全 開源免費 的企業中後台產品前端集成方案,使用最新的前端技術棧,已經做好大部分項目前期準備工作,並且帶有大量示例代碼,助力管理系統敏捷開發。"
}
}
}
}
}
@@ -105,6 +105,7 @@ export default {
{ path: `${pre}add-routes/routes`, title: '添加页面', icon: 'file-o' }
]
},
{ path: `${pre}env`, title: '环境信息', icon: 'exclamation-circle' }
{ path: `${pre}env`, title: '环境信息', icon: 'exclamation-circle' },
{ path: `${pre}locales`, title: '国际化', icon: 'language' }
])('/demo/playground/')
}
@@ -38,6 +38,7 @@ export default {
{ path: 'log/error', name: `${pre}log-error`, component: _import('demo/playground/log/error'), meta: { ...meta, title: '错误捕捉' } },
{ path: 'log/log', name: `${pre}log-log`, component: _import('demo/playground/log/log'), meta: { ...meta, title: '日志记录' } },
{ path: 'add-routes/routes', name: `${pre}add-routes-routes`, component: _import('demo/playground/add-routes/routes'), meta: { ...meta, title: '添加页面' } },
{ path: 'env', name: `${pre}env`, component: _import('demo/playground/env'), meta: { ...meta, title: '环境信息' } }
{ path: 'env', name: `${pre}env`, component: _import('demo/playground/env'), meta: { ...meta, title: '环境信息' } },
{ path: 'locales', name: `${pre}locales`, component: _import('demo/playground/locales'), meta: { ...meta, title: '国际化' } }
])('demo-playground-')
}
@@ -0,0 +1,22 @@
<template>
<d2-container>
<p class="d2-mt-0">
<el-radio-group v-model="$i18n.locale">
<el-radio-button
v-for="language in $languages"
:key="language.value"
:label="language.value">
{{ language.label }}
</el-radio-button>
</el-radio-group>
</p>
<el-alert
:title="$t('page.demo.playground.locales.text')"
type="success">
</el-alert>
<d2-link-btn
slot="footer"
title="文档"
link="https://doc.d2admin.fairyever.com/zh/sys-locales/"/>
</d2-container>
</template>

0 comments on commit fadef5b

Please sign in to comment.
You can’t perform that action at this time.