Skip to content

Commit

Permalink
style(PDFToolkit): 🌈 I18N
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocyss committed Jan 12, 2024
1 parent 60eefd6 commit 622b8e6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { RouteRecordRaw } from 'vue-router/auto'


export class EventBucket {
value: ((...args: any[]) => any)[] = []
get length() {
Expand Down
38 changes: 25 additions & 13 deletions src/views/PDFToolkit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: PDFToolkit
meta:
title: PDFToolkit
desc: PDFToolkit enables seamless splitting and merging operations on PDF files based on specified page numbers, offering convenient manipulation of PDF documents.
help: 很方便的将PDF文件按照页码进行拆分,也能很方便的将多个PDF附件合并成一个
help:
group:
tags:
- Audit
Expand Down Expand Up @@ -65,7 +65,7 @@ const disableds = computed<Array<[boolean, string]>>(() => [
],
[
!modelData.model && !modelData.pages,
t('拆分符不能为空'),
t('The split notes cannot be empty'),
],
])
Expand Down Expand Up @@ -115,7 +115,7 @@ function start(records: IRecord[], pr: Progress, inField: IAttachmentField, outF
await outField.setValue(record.recordId, files)
}
catch (e) {
layout.value?.error('未知错误', {
layout.value?.error(t('unknown mistake'), {
recordId: record.recordId,
tableId: tableId.value,
viewId: viewId.value,
Expand All @@ -132,7 +132,7 @@ function start(records: IRecord[], pr: Progress, inField: IAttachmentField, outF
async function main(all?: boolean) {
if (!table.value || !modelData.input || !modelData.output)
return
layout.value?.update(true, '获取字段信息')
layout.value?.update(true, t('Get field information'))
const [
inField,
outField,
Expand Down Expand Up @@ -169,10 +169,10 @@ onMounted(() => {
</n-space>
<n-switch v-model:value="modelData.model" style="margin-bottom: 15px;">
<template #checked>
合并模式
{{ t('Merge Mode') }}
</template>
<template #unchecked>
拆分模式
{{ t('Split Mode') }}
</template>
</n-switch>
<form-select
Expand All @@ -183,18 +183,18 @@ onMounted(() => {
<form-select
v-if="!modelData.model"
v-model:value="modelData.pages"
:msg="t('配置拆分符')"
:msg="t('Configuration split')"
input
:options="filterFields(FieldType.Text)"
@create="pagesCreate"
>
<template #tooltip>
可以手动输入,也可以指定字段
{{ t('Can be entered manually or specified by fields') }}
<n-ul style="--n-text-color:unset;">
<n-li>使用`,`来分隔单个页码,如 3,5,8 将按3,5,8页进行拆分合并为一个文件。</n-li>
<n-li>使用`-``to`来表示一个区间,如 3-7 将从第3页开始到第7页进行拆分合并为一个文件。</n-li>
<n-li>使用`/`额外创建一个文件,如 1/2-5 将拆分为两个文件,第一个文件只有第一页,第二个文件从第2页到第5页。</n-li>
<n-li>使用`start/s``end/e`来代表起始页码或结束页码,如 5-end 将从第5页拆分到最后一页,start-5 将从第1页拆分到第5页。</n-li>
<n-li>{{ t("Use `,` to separate individual page numbers, such as 3,5,8, to split and merge into one file for pages 3, 5, and 8.") }}</n-li>
<n-li>{{ t("Use `-` or `to` to indicate a range, such as 3-7, to split and merge into one file from page 3 to page 7.") }}</n-li>
<n-li>{{ t("Use `/` to create an additional file, such as 1/2-5, to split into two files, the first with only page 1, and the second from page 2 to page 5.") }}</n-li>
<n-li>{{ t("Use `start/s` or `end/e` to represent the starting page or ending page, such as 5-end, to split from page 5 to the last page, and start-5, to split from the first page to page 5.") }}</n-li>
</n-ul>
</template>
</form-select>
Expand All @@ -211,7 +211,19 @@ onMounted(() => {
</template>

<i18n locale="zh" lang="json">
{}
{
"Merge Mode": "合并模式",
"Split Mode": "拆分模式",
"Can be entered manually or specified by fields": "可以手动输入,也可以指定字段",
"Use `,` to separate individual page numbers, such as 3,5,8, to split and merge into one file for pages 3, 5, and 8.": "使用`,`来分隔单个页码,如 3,5,8 将按3,5,8页进行拆分合并为一个文件。",
"Use `-` or `to` to indicate a range, such as 3-7, to split and merge into one file from page 3 to page 7.": "使用`-`或`to`来表示一个区间,如 3-7 将从第3页开始到第7页进行拆分合并为一个文件。",
"Use `/` to create an additional file, such as 1/2-5, to split into two files, the first with only page 1, and the second from page 2 to page 5.": "使用`/`额外创建一个文件,如 1/2-5 将拆分为两个文件,第一个文件只有第一页,第二个文件从第2页到第5页。",
"Use `start/s` or `end/e` to represent the starting page or ending page, such as 5-end, to split from page 5 to the last page, and start-5, to split from the first page to page 5.": "使用`start/s`或`end/e`来代表起始页码或结束页码,如 5-end 将从第5页拆分到最后一页,start-5 将从第1页拆分到第5页。",
"Configuration split":"配置拆分符",
"The split notes cannot be empty":"拆分符不能为空",
"unknown mistake":"未知错误",
"Get field information":"获取字段信息"
}
</i18n>

<style lang="scss" scoped></style>

0 comments on commit 622b8e6

Please sign in to comment.