🚧 WIP: renderer i18n

This commit is contained in:
PiEgg 2022-01-18 23:10:49 +08:00
parent cc73fe7bce
commit be32ed0e52
4 changed files with 51 additions and 35 deletions

View File

@ -43,19 +43,19 @@
<template v-if="searchText">
<template v-if="!item.hasInstall">
<span class="config-button install" v-if="!item.ing" @click="installPlugin(item)">
安装
{{ $T('PLUGIN_INSTALL') }}
</span>
<span v-else-if="item.ing" class="config-button ing">
安装中
{{ $T('PLUGIN_INSTALLING') }}
</span>
</template>
<span v-else class="config-button ing">
已安装
{{ $T('PLUGIN_INSTALLED') }}
</span>
</template>
<template v-else>
<span v-if="item.ing" class="config-button ing">
进行中
{{ $T('PLUGIN_DOING_SOMETHING') }}
</span>
<template v-else>
<i
@ -77,12 +77,14 @@
</el-col>
</el-row>
<el-row v-show="needReload" class="reload-mask" :class="{ 'cut-width': pluginList.length > 6 }">
<el-button type="primary" @click="reloadApp" size="mini" round>重启以生效</el-button>
<el-button type="primary" @click="reloadApp" size="mini" round>{{ $T('TIPS_NEED_RELOAD') }}</el-button>
</el-row>
<el-dialog
:visible.sync="dialogVisible"
:modal-append-to-body="false"
:title="`配置${configName}`"
:title="$T('CONFIG_THING', {
c: configName
})"
width="70%"
>
<config-form
@ -93,8 +95,8 @@
>
</config-form>
<span slot="footer">
<el-button @click="dialogVisible = false" round>取消</el-button>
<el-button type="primary" @click="handleConfirmConfig" round>确定</el-button>
<el-button @click="dialogVisible = false" round>{{ $T('CANCEL') }}</el-button>
<el-button type="primary" @click="handleConfirmConfig" round>{{ $T('CONFIRM') }}</el-button>
</span>
</el-dialog>
</div>
@ -138,8 +140,7 @@ export default class extends Vue {
pluginNameList: string[] = []
loading = true
needReload = false
pluginListToolTip = '插件列表'
importLocalPluginToolTip = '导入本地插件'
pluginListToolTip = this.$T('PLUGIN_LIST')importLocalPluginToolTip = this.$T('PLUGIN_IMPORT_LOCAL')
id = ''
os = ''
defaultLogo: string = 'this.src="https://cdn.jsdelivr.net/gh/Molunerfinn/PicGo@dev/public/roundLogo.png"'
@ -264,9 +265,9 @@ export default class extends Vue {
installPlugin (item: IPicGoPlugin) {
if (!item.gui) {
this.$confirm('该插件未对可视化界面进行优化, 是否继续安装?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$T('TIPS_PLUGIN_NOT_GUI_IMPLEMENT'), this.$T('TIPS_NOTICE'), {
confirmButtonText: this.$T('CONFIRM'),
cancelButtonText: this.$T('CANCEL'),
type: 'warning'
}).then(() => {
item.ing = true
@ -309,8 +310,8 @@ export default class extends Vue {
needReload: true
})
this.needReload = true
const successNotification = new Notification('更新成功', {
body: '请点击此通知重启应用以生效'
const successNotification = new Notification(this.$T('PLUGIN_UPDATE_SUCCEED'), {
body: this.$T('TIPS_NEED_RELOAD')
})
successNotification.onclick = () => {
this.reloadApp()
@ -342,8 +343,8 @@ export default class extends Vue {
})
break
}
const successNotification = new Notification('设置结果', {
body: '设置成功'
const successNotification = new Notification(this.$T('SETTINGS_RESULT'), {
body: this.$T('TIPS_SET_SUCCEED')
})
successNotification.onclick = () => {
return true

View File

@ -4,7 +4,7 @@
@submit.native.prevent
>
<el-form-item
label="文件改名"
:label="$T('FILE_RENAME')"
>
<el-input
v-model="fileName"
@ -15,8 +15,8 @@
</el-form>
<el-row>
<div class="pull-right">
<el-button @click="cancel" round size="mini">取消</el-button>
<el-button type="primary" @click="confirmName" round size="mini">确定</el-button>
<el-button @click="cancel" round size="mini">{{ $T('CANCEL') }}</el-button>
<el-button type="primary" @click="confirmName" round size="mini">{{ $T('CONFIRM') }}</el-button>
</div>
</el-row>
</div>

View File

@ -1,7 +1,7 @@
<template>
<div id="shortcut-page">
<div class="view-title">
快捷键设置
{{ $T('SETTINGS_SET_SHORTCUT') }}
</div>
<el-row>
<el-col :span="20" :offset="2">
@ -10,7 +10,7 @@
size="mini"
>
<el-table-column
label="快捷键名称"
:label="$T('SHORTCUT_NAME')"
>
<template slot-scope="scope">
{{ scope.row.label ? scope.row.label : scope.row.name }}
@ -18,24 +18,24 @@
</el-table-column>
<el-table-column
width="160px"
label="快捷键绑定"
:label="$T('SHORTCUT_BIND')"
prop="key"
>
</el-table-column>
<el-table-column
label="状态"
:label="$T('SHORTCUT_STATUS')"
>
<template slot-scope="scope">
<el-tag
size="mini"
:type="scope.row.enable ? 'success' : 'danger'"
>
{{ scope.row.enable ? '已启用' : '已禁用' }}
{{ scope.row.enable ? $T('SHORTCUT_ENABLED') : $T('SHORTCUT_DISABLED') }}
</el-tag>
</template>
</el-table-column>
<el-table-column
label="来源"
:label="$T('SHORTCUT_SOURCE')"
width="100px"
>
<template slot-scope="scope">
@ -43,7 +43,7 @@
</template>
</el-table-column>
<el-table-column
label="操作"
:label="$T('SHORTCUT_HANDLE')"
>
<template slot-scope="scope">
<el-button
@ -53,14 +53,14 @@
disabled: scope.row.enable
}"
type="text">
{{ scope.row.enable ? '禁用' : '启用' }}
{{ scope.row.enable ? $T('SHORTCUT_DISABLE') : $T('SHORTCUT_ENABLE') }}
</el-button>
<el-button
class="edit"
size="mini"
@click="openKeyBindingDialog(scope.row, scope.$index)"
type="text">
编辑
{{ $T('SHORTCUT_EDIT') }}
</el-button>
</template>
</el-table-column>
@ -68,7 +68,7 @@
</el-col>
</el-row>
<el-dialog
title="修改上传快捷键"
:title="$T('SHORTCUT_CHANGE_UPLOAD')"
:visible.sync="keyBindingVisible"
:modal-append-to-body="false"
>
@ -76,9 +76,7 @@
label-position="top"
label-width="80px"
>
<el-form-item
label="快捷上传"
>
<el-form-item>
<el-input
class="align-center"
@keydown.native.prevent="keyDetect($event)"
@ -88,8 +86,12 @@
</el-form-item>
</el-form>
<span slot="footer">
<el-button @click="cancelKeyBinding" round>取消</el-button>
<el-button type="primary" @click="confirmKeyBinding" round>确定</el-button>
<el-button @click="cancelKeyBinding" round>
{{ $T('CANCEL') }}
</el-button>
<el-button type="primary" @click="confirmKeyBinding" round>
{{ $T('CONFIRM') }}
</el-button>
</span>
</el-dialog>
</div>

View File

@ -50,6 +50,7 @@ export const ZH_CN = {
CHANGE_IMAGE_URL_SUCCEED: '修改图片URL成功',
COPY_LINK_SUCCEED: '复制链接成功',
BATCH_COPY_LINK_SUCCEED: '批量复制链接成功',
FILE_RENAME: '文件改名',
// settings
SETTINGS_OPEN_CONFIG_FILE: '打开配置文件',
@ -99,6 +100,18 @@ export const ZH_CN = {
SETTINGS_LOG_LEVEL_NONE: '不记录日志-None',
SETTINGS_RESULT: '设置结果',
SHORTCUT_NAME: '快捷键名称',
SHORTCUT_BIND: '快捷键绑定',
SHORTCUT_STATUS: '状态',
SHORTCUT_ENABLED: '已启用',
SHORTCUT_DISABLED: '已禁用',
SHORTCUT_SOURCE: '已禁用',
SHORTCUT_HANDLE: '操作',
SHORTCUT_ENABLE: '启用',
SHORTCUT_DISABLE: '禁用',
SHORTCUT_EDIT: '编辑',
SHORTCUT_CHANGE_UPLOAD: '修改上传快捷键',
// plugins
PLUGIN_SEARCH_PLACEHOLDER: '搜索npm上的PicGo插件或者点击上方按钮查看优秀插件列表',
PLUGIN_INSTALL: '安装',