mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 11:08:13 -05:00
🚧 WIP: renderer process i18n
This commit is contained in:
parent
be32ed0e52
commit
1212774b3d
@ -3,7 +3,7 @@
|
||||
<!-- <div class="header-arrow"></div> -->
|
||||
<div class="content">
|
||||
<div class="wait-upload-img" v-if="clipboardFiles.length > 0">
|
||||
<div class="list-title">等待上传</div>
|
||||
<div class="list-title">{{ $T('WAIT_TO_UPLOAD') }}</div>
|
||||
<div v-for="(item, index) in clipboardFiles" :key="index" class="img-list">
|
||||
<div
|
||||
class="upload-img__container"
|
||||
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="uploaded-img">
|
||||
<div class="list-title">已上传</div>
|
||||
<div class="list-title">{{ $T('ALREADY_UPLOAD') }}</div>
|
||||
<div v-for="item in files" :key="item.imgUrl" class="img-list">
|
||||
<div class="upload-img__container" @click="copyTheLink(item)">
|
||||
<img :src="item.imgUrl" class="upload-img">
|
||||
@ -39,7 +39,7 @@ import { PASTE_TEXT } from '#/events/constants'
|
||||
export default class extends Vue {
|
||||
files: IResult<ImgInfo>[] = []
|
||||
notification = {
|
||||
title: '复制链接成功',
|
||||
title: this.$T('COPY_LINK_SUCCEED'),
|
||||
body: '',
|
||||
icon: ''
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="20" :offset="2">
|
||||
<div class="view-title">
|
||||
图片上传 - {{ picBedName }} <i class="el-icon-caret-bottom" @click="handleChangePicBed"></i>
|
||||
{{ $T('PICTURE_UPLOAD') }} - {{ picBedName }} <i class="el-icon-caret-bottom" @click="handleChangePicBed"></i>
|
||||
</div>
|
||||
<div
|
||||
id="upload-area"
|
||||
@ -15,7 +15,7 @@
|
||||
<div id="upload-dragger" @click="openUplodWindow">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="upload-dragger__text">
|
||||
将文件拖到此处,或 <span>点击上传</span>
|
||||
{{ $T('DRAG_FILE_TO_HERE') }} <span>{{ $T('CLICK_TO_UPLOAD') }}</span>
|
||||
</div>
|
||||
<input type="file" id="file-uploader" @change="onChange" multiple>
|
||||
</div>
|
||||
@ -30,7 +30,7 @@
|
||||
<div class="paste-style">
|
||||
<div class="el-col-16">
|
||||
<div class="paste-style__text">
|
||||
链接格式
|
||||
{{ $T('LINK_FORMAT') }}
|
||||
</div>
|
||||
<el-radio-group v-model="pasteStyle" size="mini"
|
||||
@change="handlePasteStyleChange"
|
||||
@ -41,14 +41,14 @@
|
||||
<el-radio-button label="HTML"></el-radio-button>
|
||||
<el-radio-button label="URL"></el-radio-button>
|
||||
<el-radio-button label="UBB"></el-radio-button>
|
||||
<el-radio-button label="Custom" title="自定义"></el-radio-button>
|
||||
<el-radio-button label="Custom" :title="$T('CUSTOM')"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="el-col-8">
|
||||
<div class="paste-style__text">
|
||||
快捷上传
|
||||
{{ $T('QUICK_UPLOAD') }}
|
||||
</div>
|
||||
<el-button type="primary" round size="mini" @click="uploadClipboardFiles" class="quick-upload" style="width: 50%">剪贴板图片</el-button>
|
||||
<el-button type="primary" round size="mini" @click="uploadClipboardFiles" class="quick-upload" style="width: 50%">{{ $T('CLIPBOARD_PICTURE') }}</el-button>
|
||||
<el-button type="primary" round size="mini" @click="uploadURLFiles" class="quick-upload" style="width: 46%; margin-left: 6px">URL</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@ -131,7 +131,7 @@ export default class extends Vue {
|
||||
if (isUrl(str)) {
|
||||
ipcRenderer.send('uploadChoosedFiles', [{ path: str }])
|
||||
} else {
|
||||
this.$message.error('请拖入合法的图片文件或者图片URL地址')
|
||||
this.$message.error(this.$T('TIPS_DRAG_VALID_PICTURE_OR_URL'))
|
||||
}
|
||||
} else {
|
||||
this.ipcSendFiles(e.dataTransfer!.files)
|
||||
@ -150,7 +150,7 @@ export default class extends Vue {
|
||||
}
|
||||
])
|
||||
} else {
|
||||
this.$message.error('请拖入合法的图片文件或者图片URL地址')
|
||||
this.$message.error(this.$T('TIPS_DRAG_VALID_PICTURE_OR_URL'))
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,8 +193,8 @@ export default class extends Vue {
|
||||
const str = await navigator.clipboard.readText()
|
||||
this.$bus.$emit(SHOW_INPUT_BOX, {
|
||||
value: isUrl(str) ? str : '',
|
||||
title: '请输入URL',
|
||||
placeholder: 'http://或者https://开头'
|
||||
title: this.$T('TIPS_INPUT_URL'),
|
||||
placeholder: this.$T('TIPS_HTTP_PREFIX')
|
||||
})
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ export default class extends Vue {
|
||||
path: val
|
||||
}])
|
||||
} else {
|
||||
this.$message.error('请输入合法的URL')
|
||||
this.$message.error(this.$T('TIPS_INPUT_VALID_URL'))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-row :gutter="16" class="setting-list">
|
||||
<el-col :span="16" :offset="4">
|
||||
<div class="view-title">
|
||||
{{ picBedName }}设置
|
||||
{{ picBedName }}{{ $T('SETTINGS') }}
|
||||
</div>
|
||||
<config-form
|
||||
v-if="config.length > 0"
|
||||
@ -14,14 +14,14 @@
|
||||
>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="handleConfirm" round>确定</el-button>
|
||||
<el-button type="success" @click="setDefaultPicBed(type)" round :disabled="defaultPicBed === type">设为默认图床</el-button>
|
||||
<el-button type="primary" @click="handleConfirm" round>{{ $T('CONFIRM') }}</el-button>
|
||||
<el-button type="success" @click="setDefaultPicBed(type)" round :disabled="defaultPicBed === type">{{ $T('SETTINGS_SET_DEFAULT_PICBED') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</config-form>
|
||||
<div v-else class="single">
|
||||
<div class="notice">暂无配置项</div>
|
||||
<el-button type="success" @click="setDefaultPicBed(type)" round :disabled="defaultPicBed === type" size="mini">设为默认图床</el-button>
|
||||
<div class="notice">{{ $T('SETTINGS_NOT_CONFIG_OPTIONS') }}</div>
|
||||
<el-button type="success" @click="setDefaultPicBed(type)" round :disabled="defaultPicBed === type" size="mini">{{ $T('SETTINGS_SET_DEFAULT_PICBED') }}</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -60,8 +60,8 @@ export default class extends Vue {
|
||||
this.saveConfig({
|
||||
[`picBed.${this.type}`]: result
|
||||
})
|
||||
const successNotification = new Notification('设置结果', {
|
||||
body: '设置成功'
|
||||
const successNotification = new Notification(this.$T('SETTINGS_RESULT'), {
|
||||
body: this.$T('TIPS_SET_SUCCEED')
|
||||
})
|
||||
successNotification.onclick = () => {
|
||||
return true
|
||||
@ -76,8 +76,8 @@ export default class extends Vue {
|
||||
})
|
||||
// @ts-ignore 来自mixin的数据
|
||||
this.defaultPicBed = type
|
||||
const successNotification = new Notification('设置默认图床', {
|
||||
body: '设置成功'
|
||||
const successNotification = new Notification(this.$T('SETTINGS_DEFAULT_PICBED'), {
|
||||
body: this.$T('TIPS_SET_SUCCEED')
|
||||
})
|
||||
successNotification.onclick = () => {
|
||||
return true
|
||||
|
@ -17,7 +17,7 @@
|
||||
:rules="{
|
||||
required: true, message: 'Token不能为空', trigger: 'blur'
|
||||
}">
|
||||
<el-input v-model="form.token" type="password" placeholder="token" @keyup.native.enter="confirm('smmsForm')"></el-input>
|
||||
<el-input v-model="form.token" type="password" placeholder="token" @keyup.native.enter="confirm"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
|
@ -16,8 +16,8 @@ export default class extends Vue {
|
||||
'picBed.uploader': type
|
||||
})
|
||||
this.defaultPicBed = type
|
||||
const successNotification = new Notification('设置默认图床', {
|
||||
body: '设置成功'
|
||||
const successNotification = new Notification(this.$T('SETTINGS_DEFAULT_PICBED'), {
|
||||
body: this.$T('TIPS_SET_SUCCEED')
|
||||
})
|
||||
successNotification.onclick = () => {
|
||||
return true
|
||||
|
@ -53,6 +53,7 @@ export const ZH_CN = {
|
||||
FILE_RENAME: '文件改名',
|
||||
|
||||
// settings
|
||||
SETTINGS: '设置',
|
||||
SETTINGS_OPEN_CONFIG_FILE: '打开配置文件',
|
||||
SETTINGS_CLICK_TO_OPEN: '点击打开',
|
||||
SETTINGS_SET_LOG_FILE: '设置日志文件',
|
||||
@ -99,7 +100,11 @@ export const ZH_CN = {
|
||||
SETTINGS_LOG_LEVEL_WARN: '提醒-Warn',
|
||||
SETTINGS_LOG_LEVEL_NONE: '不记录日志-None',
|
||||
SETTINGS_RESULT: '设置结果',
|
||||
SETTINGS_DEFAULT_PICBED: '设置默认图床',
|
||||
SETTINGS_SET_DEFAULT_PICBED: '设为默认图床',
|
||||
SETTINGS_NOT_CONFIG_OPTIONS: '暂无配置项',
|
||||
|
||||
// shortcut page
|
||||
SHORTCUT_NAME: '快捷键名称',
|
||||
SHORTCUT_BIND: '快捷键绑定',
|
||||
SHORTCUT_STATUS: '状态',
|
||||
@ -112,6 +117,22 @@ export const ZH_CN = {
|
||||
SHORTCUT_EDIT: '编辑',
|
||||
SHORTCUT_CHANGE_UPLOAD: '修改上传快捷键',
|
||||
|
||||
// tray page
|
||||
WAIT_TO_UPLOAD: '等待上传',
|
||||
ALREADY_UPLOAD: '已上传',
|
||||
|
||||
// uload page
|
||||
PICTURE_UPLOAD: '图片上传',
|
||||
DRAG_FILE_TO_HERE: '将文件拖拽到此处,或',
|
||||
CLICK_TO_UPLOAD: '点击上传',
|
||||
LINK_FORMAT: '链接格式',
|
||||
CUSTOM: '自定义',
|
||||
CLIPBOARD_PICTURE: '剪贴板图片',
|
||||
TIPS_DRAG_VALID_PICTURE_OR_URL: '请拖入合法的图片文件或者图片URL地址',
|
||||
TIPS_INPUT_URL: '请输入URL',
|
||||
TIPS_HTTP_PREFIX: 'http://或者https://开头',
|
||||
TIPS_INPUT_VALID_URL: '请输入合法的URL',
|
||||
|
||||
// plugins
|
||||
PLUGIN_SEARCH_PLACEHOLDER: '搜索npm上的PicGo插件,或者点击上方按钮查看优秀插件列表',
|
||||
PLUGIN_INSTALL: '安装',
|
||||
|
2
src/universal/types/extra-vue.d.ts
vendored
2
src/universal/types/extra-vue.d.ts
vendored
@ -22,5 +22,7 @@ declare module 'vue/types/vue' {
|
||||
$T: typeof import('#/i18n/index').T
|
||||
saveConfig(data: IObj | string, value?: any): void
|
||||
getConfig<T>(key?: string): Promise<T | undefined>
|
||||
setDefaultPicBed(picBed: string): void
|
||||
defaultPicBed: string
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user