Skip to content

Commit

Permalink
feat: about i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdan-fit2cloud committed Jan 21, 2025
1 parent 2972353 commit a9cc341
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 38 deletions.
2 changes: 1 addition & 1 deletion ui/src/layout/components/app-header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="app-header" :class="!isDefaultTheme ? 'custom-header' : ''">
<el-alert
v-if="user.isExpire()"
title="未上传 License 或 License 已过期。"
:title="$t('layout.isExpire')"
type="warning"
class="border-b"
show-icon
Expand Down
2 changes: 1 addition & 1 deletion ui/src/layout/components/breadcrumb/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<template v-else-if="isDataset">
<div class="w-full text-left cursor" @click="openCreateDialog">
<el-button link>
<el-icon class="mr-4"><Plus /></el-icon> 创建知识库
<el-icon class="mr-4"><Plus /></el-icon> {{ $t('views.dataset.createDataset') }}
</el-button>
</div>
</template>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/layout/components/top-bar/avatar/APIKeyDialog.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<el-dialog
:title="$t('layout.avatar.apiKey')"
:title="$t('layout.apiKey')"
v-model="dialogVisible"
width="800"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-card shadow="never" class="layout-bg mb-16">
<el-text type="info" class="color-secondary">{{
$t('layout.avatar.apiServiceAddress')
$t('layout.apiServiceAddress')
}}</el-text>
<p style="margin-top: 10px">
<span class="vertical-middle lighter break-all">
Expand Down
14 changes: 7 additions & 7 deletions ui/src/layout/components/top-bar/avatar/AboutDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</template>
<div class="about-ui" v-loading="loading">
<div class="flex">
<span class="label">授权给</span><span>{{ licenseInfo?.corporation || '-' }}</span>
<span class="label">{{ $t('layout.about.authorize') }}</span><span>{{ licenseInfo?.corporation || '-' }}</span>
</div>
<div class="flex">
<span class="label">到期时间</span>
<span class="label">{{ $t('layout.about.expiredTime') }}</span>
<span
>{{ licenseInfo?.expired || '-' }}
<span class="danger" v-if="licenseInfo?.expired && fromNowDate(licenseInfo?.expired)"
Expand All @@ -23,16 +23,16 @@
>
</div>
<div class="flex">
<span class="label">版本</span><span>{{ user.showXpack() ? '专业版' : '社区版' }}</span>
<span class="label">{{ $t('layout.about.edition') }}</span><span>{{ user.showXpack() ? '专业版' : '社区版' }}</span>
</div>
<div class="flex">
<span class="label">版本号</span><span>{{ user.version }}</span>
<span class="label">{{ $t('layout.about.version') }}</span><span>{{ user.version }}</span>
</div>
<div class="flex">
<span class="label">序列号</span><span>{{ licenseInfo?.serialNo || '-' }}</span>
<span class="label">{{ $t('layout.about.serialNo') }}</span><span>{{ licenseInfo?.serialNo || '-' }}</span>
</div>
<div class="flex">
<span class="label">备注</span><span>{{ licenseInfo?.remark || '-' }}</span>
<span class="label">{{ $t('layout.about.remark') }}</span><span>{{ licenseInfo?.remark || '-' }}</span>
</div>
<div class="mt-16 flex align-center" v-if="user.showXpack()">
<el-upload
Expand All @@ -43,7 +43,7 @@
:on-change="onChange"
v-hasPermission="new Role('ADMIN')"
>
<el-button class="border-primary mr-16">更新 License</el-button>
<el-button class="border-primary mr-16">{{ $t('layout.about.update') }} License</el-button>
</el-upload>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions ui/src/layout/components/top-bar/avatar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</el-dropdown-item>
<div v-hasPermission="new ComplexPermission([], ['x-pack'], 'OR')">
<el-dropdown-item class="border-t p-8" @click="openAPIKeyDialog">
{{ $t('layout.avatar.apiKey') }}
{{ $t('layout.apiKey') }}
</el-dropdown-item>
</div>
<el-dropdown-item class="border-t" style="padding: 0" @click.stop>
Expand Down Expand Up @@ -60,11 +60,11 @@
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item class="border-t" @click="openAbout">
{{ $t('layout.avatar.about') }}
{{ $t('layout.about.label') }}
</el-dropdown-item>

<el-dropdown-item class="border-t" @click="logout">
{{ $t('layout.avatar.logout') }}
{{ $t('layout.logout') }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
Expand Down
23 changes: 15 additions & 8 deletions ui/src/locales/lang/en-US/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ export default {
github: 'Project Address',
wiki: 'User Manual',
forum: 'Forum For Help',
avatar: {
about: 'About',
logout: 'Logout',
version: 'Version',
apiKey: 'API Key',
apiServiceAddress: 'API Service Address',
},
language: 'Language'
logout: 'Logout',
version: 'Version',
apiKey: 'API Key',
apiServiceAddress: 'API Service Address',
language: 'Language',
isExpire: 'License not uploaded or expired',
about: {
title: 'About',
expiredTime: 'Expiration Date',
edition: 'Edition',
serialNo: 'Serial No.',
remark: 'Remarks',
update: 'Update',
authorize: 'Authorized'
}
}
23 changes: 15 additions & 8 deletions ui/src/locales/lang/zh-CN/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ export default {
github: '项目地址',
wiki: '用户手册',
forum: '论坛求助',
avatar: {
about: '关于',
logout: '退出',
version: '版本号',
apiKey: 'API Key 管理',
apiServiceAddress: 'API 服务地址',
},
language: '语言'
logout: '退出',
version: '版本号',
apiKey: 'API Key 管理',
apiServiceAddress: 'API 服务地址',
language: '语言',
isExpire: '未上传 License 或 License 已过期。',
about: {
title: '关于',
expiredTime: '到期时间',
edition: '版本',
serialNo: '序列号',
remark: '备注',
update: '更新',
authorize:'授权给'
}
}
23 changes: 15 additions & 8 deletions ui/src/locales/lang/zh-Hant/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ export default {
github: '項目地址',
wiki: '使用者手冊',
forum: '論壇求助',
avatar: {
about: '關於',
logout: '退出',
version: '版本號',
apiKey: 'API Key 管理',
apiServiceAddress: 'API 服務地址',
},
language: '語言'
logout: '退出',
version: '版本號',
apiKey: 'API Key 管理',
apiServiceAddress: 'API 服務地址',
language: '語言',
isExpire: '未上傳 License 或 License 已過期。',
about: {
title: '關於',
expiredTime: '到期時間',
edition: '版本',
serialNo: '序列號',
remark: '備註',
update: '更新',
authorize: '授權給'
}
}

0 comments on commit a9cc341

Please sign in to comment.