From ae71454a382f1673124d6a2df1722ee04fd822fa Mon Sep 17 00:00:00 2001 From: Amery2010 Date: Wed, 21 Feb 2024 15:56:48 +0800 Subject: [PATCH] feat(translate): Complete translation of all tools --- .../benchmark-builder/benchmark-builder.vue | 29 ++++++++--------- .../benchmark-builder/dynamic-values.vue | 7 +++-- src/tools/benchmark-builder/index.ts | 5 +-- src/tools/benchmark-builder/locales/en.yml | 26 ++++++++++++++++ src/tools/benchmark-builder/locales/zh.yml | 26 ++++++++++++++++ src/tools/chronometer/chronometer.vue | 7 +++-- src/tools/chronometer/index.ts | 5 +-- src/tools/chronometer/locales/en.yml | 8 +++++ src/tools/chronometer/locales/zh.yml | 8 +++++ src/tools/emoji-picker/emoji-card.vue | 7 +++-- src/tools/emoji-picker/emoji-picker.vue | 7 +++-- src/tools/emoji-picker/index.ts | 5 +-- src/tools/emoji-picker/locales/en.yml | 12 +++++++ src/tools/emoji-picker/locales/zh.yml | 12 +++++++ .../iban-validator-and-parser.service.ts | 17 +++++----- .../iban-validator-and-parser.vue | 17 +++++----- src/tools/iban-validator-and-parser/index.ts | 5 +-- .../iban-validator-and-parser/locales/en.yml | 22 +++++++++++++ .../iban-validator-and-parser/locales/zh.yml | 22 +++++++++++++ src/tools/lorem-ipsum-generator/index.ts | 6 ++-- .../lorem-ipsum-generator/locales/en.yml | 14 +++++++++ .../lorem-ipsum-generator/locales/zh.yml | 14 +++++++++ .../lorem-ipsum-generator.vue | 17 +++++----- src/tools/numeronym-generator/index.ts | 5 +-- src/tools/numeronym-generator/locales/en.yml | 7 +++++ src/tools/numeronym-generator/locales/zh.yml | 7 +++++ .../numeronym-generator.vue | 5 +-- src/tools/phone-parser-and-formatter/index.ts | 6 ++-- .../phone-parser-and-formatter/locales/en.yml | 31 +++++++++++++++++++ .../phone-parser-and-formatter/locales/zh.yml | 31 +++++++++++++++++++ .../phone-parser-and-formatter.models.ts | 23 +++++++------- .../phone-parser-and-formatter.vue | 31 ++++++++++--------- src/tools/string-obfuscator/index.ts | 5 +-- src/tools/string-obfuscator/locales/en.yml | 10 ++++++ src/tools/string-obfuscator/locales/zh.yml | 10 ++++++ .../string-obfuscator/string-obfuscator.vue | 9 +++--- src/tools/temperature-converter/index.ts | 6 ++-- .../temperature-converter/locales/en.yml | 13 ++++++++ .../temperature-converter/locales/zh.yml | 13 ++++++++ .../temperature-converter.vue | 17 +++++----- src/tools/text-diff/index.ts | 5 +-- src/tools/text-diff/locales/en.yml | 4 +++ src/tools/text-diff/locales/zh.yml | 4 +++ src/tools/text-statistics/index.ts | 5 +-- src/tools/text-statistics/locales/en.yml | 10 ++++++ src/tools/text-statistics/locales/zh.yml | 10 ++++++ src/tools/text-statistics/text-statistics.vue | 11 ++++--- 47 files changed, 456 insertions(+), 120 deletions(-) create mode 100644 src/tools/benchmark-builder/locales/en.yml create mode 100644 src/tools/benchmark-builder/locales/zh.yml create mode 100644 src/tools/chronometer/locales/en.yml create mode 100644 src/tools/chronometer/locales/zh.yml create mode 100644 src/tools/emoji-picker/locales/en.yml create mode 100644 src/tools/emoji-picker/locales/zh.yml create mode 100644 src/tools/iban-validator-and-parser/locales/en.yml create mode 100644 src/tools/iban-validator-and-parser/locales/zh.yml create mode 100644 src/tools/lorem-ipsum-generator/locales/en.yml create mode 100644 src/tools/lorem-ipsum-generator/locales/zh.yml create mode 100644 src/tools/numeronym-generator/locales/en.yml create mode 100644 src/tools/numeronym-generator/locales/zh.yml create mode 100644 src/tools/phone-parser-and-formatter/locales/en.yml create mode 100644 src/tools/phone-parser-and-formatter/locales/zh.yml create mode 100644 src/tools/string-obfuscator/locales/en.yml create mode 100644 src/tools/string-obfuscator/locales/zh.yml create mode 100644 src/tools/temperature-converter/locales/en.yml create mode 100644 src/tools/temperature-converter/locales/zh.yml create mode 100644 src/tools/text-diff/locales/en.yml create mode 100644 src/tools/text-diff/locales/zh.yml create mode 100644 src/tools/text-statistics/locales/en.yml create mode 100644 src/tools/text-statistics/locales/zh.yml diff --git a/src/tools/benchmark-builder/benchmark-builder.vue b/src/tools/benchmark-builder/benchmark-builder.vue index 93911428..e4968ee9 100644 --- a/src/tools/benchmark-builder/benchmark-builder.vue +++ b/src/tools/benchmark-builder/benchmark-builder.vue @@ -7,6 +7,7 @@ import { arrayToMarkdownTable, computeAverage, computeVariance } from './benchma import DynamicValues from './dynamic-values.vue'; import { useCopy } from '@/composable/copy'; +const { t } = useI18n(); const suites = useStorage('benchmark-builder:suites', [ { title: 'Suite 1', data: [5, 10] }, { title: 'Suite 2', data: [8, 12] }, @@ -51,11 +52,11 @@ const results = computed(() => { const { copy } = useCopy({ createToast: false }); const header = { - position: 'Position', - title: 'Suite', - size: 'Samples', - mean: 'Mean', - variance: 'Variance', + position: t('tools.benchmark-builder.header.position'), + title: t('tools.benchmark-builder.header.title'), + size: t('tools.benchmark-builder.header.size'), + mean: t('tools.benchmark-builder.header.mean'), + variance: t('tools.benchmark-builder.header.variance'), }; function copyAsMarkdown() { @@ -86,13 +87,13 @@ function copyAsBulletList() { - + @@ -100,14 +101,14 @@ function copyAsBulletList() {
- Delete suite + {{ t('tools.benchmark-builder.deleteSuite') }} - Add suite + {{ t('tools.benchmark-builder.addSuite') }}
@@ -117,7 +118,7 @@ function copyAsBulletList() {
- + - Reset suites + {{ t('tools.benchmark-builder.resetSuites') }}
@@ -135,10 +136,10 @@ function copyAsBulletList() {
- Copy as markdown table + {{ t('tools.benchmark-builder.copyAsMarkdown') }} - Copy as bullet list + {{ t('tools.benchmark-builder.copyAsBulletList') }}
diff --git a/src/tools/benchmark-builder/dynamic-values.vue b/src/tools/benchmark-builder/dynamic-values.vue index e048ef99..1abb5f89 100644 --- a/src/tools/benchmark-builder/dynamic-values.vue +++ b/src/tools/benchmark-builder/dynamic-values.vue @@ -10,6 +10,7 @@ const emit = defineEmits(['update:values']); const refs = useTemplateRefsList(); +const { t } = useI18n(); const values = useVModel(props, 'values', emit); async function addValue() { @@ -35,11 +36,11 @@ function onInputEnter(index: number) { :ref="refs.set" v-model:value="values[index]" :show-button="false" - placeholder="Set your measure..." + :placeholder="t('tools.benchmark-builder.setYourMeasure')" autofocus @keydown.enter="onInputEnter(index)" /> - + @@ -48,7 +49,7 @@ function onInputEnter(index: number) { - Add a measure + {{ t('tools.benchmark-builder.addAMeasure') }}
diff --git a/src/tools/benchmark-builder/index.ts b/src/tools/benchmark-builder/index.ts index 51eb8058..788f0f1a 100644 --- a/src/tools/benchmark-builder/index.ts +++ b/src/tools/benchmark-builder/index.ts @@ -1,10 +1,11 @@ import { SpeedFilled } from '@vicons/material'; import { defineTool } from '../tool'; +import { translate as t } from '@/plugins/i18n.plugin'; export const tool = defineTool({ - name: 'Benchmark builder', + name: t('tools.benchmark-builder.title'), path: '/benchmark-builder', - description: 'Easily compare execution time of tasks with this very simple online benchmark builder.', + description: t('tools.benchmark-builder.description'), keywords: ['benchmark', 'builder', 'execution', 'duration', 'mean', 'variance'], component: () => import('./benchmark-builder.vue'), icon: SpeedFilled, diff --git a/src/tools/benchmark-builder/locales/en.yml b/src/tools/benchmark-builder/locales/en.yml new file mode 100644 index 00000000..650d52a6 --- /dev/null +++ b/src/tools/benchmark-builder/locales/en.yml @@ -0,0 +1,26 @@ +tools: + benchmark-builder: + title: Benchmark builder + description: Easily compare execution time of tasks with this very simple online benchmark builder. + + header: + position: Position + title: Suite + size: Samples + mean: Mean + variance: Variance + suiteNameLabel: Suite name + suiteNamePlaceholder: Suite name... + suiteValues: Suite values + suiteTitle: Suite {index} + deleteSuite: Delete suite + addSuite: Add suite + resetSuites: Reset suites + unitLabel: Unit + unitPlaceholder: 'Unit (eg: ms)' + setYourMeasure: Set your measure... + deleteThisValue: Delete this value + addAMeasure: Add a measure + + copyAsMarkdown: Copy as markdown table + copyAsBulletList: Copy as bullet list diff --git a/src/tools/benchmark-builder/locales/zh.yml b/src/tools/benchmark-builder/locales/zh.yml new file mode 100644 index 00000000..739cecf7 --- /dev/null +++ b/src/tools/benchmark-builder/locales/zh.yml @@ -0,0 +1,26 @@ +tools: + benchmark-builder: + title: 基准测试生成器 + description: 使用这个非常简单的在线基准测试生成器轻松比较任务的执行时间。 + + header: + position: 位置 + title: 套件 + size: 样本数 + mean: 平均值 + variance: 方差 + suiteNameLabel: 套件名称 + suiteNamePlaceholder: 输入套件名称... + suiteValues: 套件数值 + suiteTitle: 套件 {index} + deleteSuite: 删除套件 + addSuite: 添加套件 + resetSuites: 重置套件 + unitLabel: 单位 + unitPlaceholder: '单位(例如:毫秒)' + setYourMeasure: 设置您的度量... + deleteThisValue: 删除此数值 + addAMeasure: 添加一个度量 + + copyAsMarkdown: 复制为 markdown 表格 + copyAsBulletList: 复制为项目列表 diff --git a/src/tools/chronometer/chronometer.vue b/src/tools/chronometer/chronometer.vue index 9ed6fead..f15718b7 100644 --- a/src/tools/chronometer/chronometer.vue +++ b/src/tools/chronometer/chronometer.vue @@ -3,6 +3,7 @@ import { useRafFn } from '@vueuse/core'; import { formatMs } from './chronometer.service'; +const { t } = useI18n(); const isRunning = ref(false); const counter = ref(0); @@ -37,14 +38,14 @@ function pause() {
- Start + {{ t('tools.chronometer.start') }} - Stop + {{ t('tools.chronometer.stop') }} - Reset + {{ t('tools.chronometer.reset') }}
diff --git a/src/tools/chronometer/index.ts b/src/tools/chronometer/index.ts index 424d03dc..de76fb41 100644 --- a/src/tools/chronometer/index.ts +++ b/src/tools/chronometer/index.ts @@ -1,10 +1,11 @@ import { TimerOutlined } from '@vicons/material'; import { defineTool } from '../tool'; +import { translate as t } from '@/plugins/i18n.plugin'; export const tool = defineTool({ - name: 'Chronometer', + name: t('tools.chronometer.title'), path: '/chronometer', - description: 'Monitor the duration of a thing. Basically a chronometer with simple chronometer features.', + description: t('tools.chronometer.description'), keywords: ['chronometer', 'time', 'lap', 'duration', 'measure', 'pause', 'resume', 'stopwatch'], component: () => import('./chronometer.vue'), icon: TimerOutlined, diff --git a/src/tools/chronometer/locales/en.yml b/src/tools/chronometer/locales/en.yml new file mode 100644 index 00000000..16ec31fb --- /dev/null +++ b/src/tools/chronometer/locales/en.yml @@ -0,0 +1,8 @@ +tools: + chronometer: + title: Chronometer + description: Monitor the duration of a thing. Basically a chronometer with simple chronometer features. + + start: Start + stop: Stop + reset: Reset diff --git a/src/tools/chronometer/locales/zh.yml b/src/tools/chronometer/locales/zh.yml new file mode 100644 index 00000000..6eee8617 --- /dev/null +++ b/src/tools/chronometer/locales/zh.yml @@ -0,0 +1,8 @@ +tools: + chronometer: + title: 计时器 + description: 监控事物的持续时间。基本上是一个具有简单计时器功能的计时器。 + + start: 开始 + stop: 停止 + reset: 重置 diff --git a/src/tools/emoji-picker/emoji-card.vue b/src/tools/emoji-picker/emoji-card.vue index e2977862..519cab4f 100644 --- a/src/tools/emoji-picker/emoji-card.vue +++ b/src/tools/emoji-picker/emoji-card.vue @@ -5,12 +5,13 @@ import { useCopy } from '@/composable/copy'; const props = (defineProps<{ emojiInfo: EmojiInfo }>()); const { emojiInfo } = toRefs(props); +const { t } = useI18n(); const { copy } = useCopy();