Skip to content

Commit 4103bd7

Browse files
committed
i18n: extract more strings
1 parent 92bf2b5 commit 4103bd7

7 files changed

Lines changed: 1783 additions & 1808 deletions

File tree

locales/en.yml

Lines changed: 1694 additions & 1725 deletions
Large diffs are not rendered by default.

src/tools/base64-file-converter/base64-file-converter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async function onUpload(file: File) {
141141

142142
<n-space justify="center" mb-1>
143143
<n-checkbox v-model:checked="includeDataUri">
144-
Include data: URI prefix
144+
{{ $t('tools.base64-file-converter.texts.include-data-uri-prefix') }}
145145
</n-checkbox>
146146
</n-space>
147147

src/tools/html-to-pdf/html-to-pdf.vue

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<script setup lang="ts">
2+
import { useI18n } from 'vue-i18n';
23
import { useITStorage } from '@/composable/queryParams';
34
import { Base64 } from 'js-base64';
45
6+
const { t } = useI18n();
7+
58
const url = ref('');
69
const html = ref('');
710
const error = ref('');
@@ -26,12 +29,12 @@ const options = useITStorage('html-to-pdf:opts', {
2629
});
2730
2831
const pdfFormats = [
29-
{ label: 'A2', value: 'A2' },
30-
{ label: 'A3', value: 'A3' },
31-
{ label: 'A4', value: 'A4' },
32-
{ label: 'A5', value: 'A5' },
33-
{ label: 'Letter', value: 'Letter' },
34-
{ label: 'Legal', value: 'Legal' },
32+
{ label: t('tools.html-to-pdf.texts.label-a2'), value: 'A2' },
33+
{ label: t('tools.html-to-pdf.texts.label-a3'), value: 'A3' },
34+
{ label: t('tools.html-to-pdf.texts.label-a4'), value: 'A4' },
35+
{ label: t('tools.html-to-pdf.texts.label-a5'), value: 'A5' },
36+
{ label: t('tools.html-to-pdf.texts.label-letter'), value: 'Letter' },
37+
{ label: t('tools.html-to-pdf.texts.label-legal'), value: 'Legal' },
3538
];
3639
3740
function downloadURL(data: string, fileName: string) {
@@ -186,28 +189,27 @@ async function generateBatch() {
186189
<template>
187190
<div>
188191
<details mb-2>
189-
<summary>HTML to PDF Service Configuration (self hosted)</summary>
192+
<summary>{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-configuration-self-hosted') }}</summary>
190193
<n-card>
191-
<NFormItem label="HTML to PDF Service Url:" label-placement="top">
192-
<NInput v-model:value="serverHost" placeholder="http://localhost:3000" />
194+
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-to-pdf-service-url')" label-placement="top">
195+
<NInput v-model:value="serverHost" :placeholder="t('tools.html-to-pdf.texts.placeholder-http-localhost-3000')" />
193196
</NFormItem>
194-
<NFormItem label="Basic Authentication:" label-placement="left" label-width="auto">
195-
<NInput v-model:value="serverAuth" placeholder="username:password" />
197+
<NFormItem :label="t('tools.html-to-pdf.texts.label-basic-authentication')" label-placement="left" label-width="auto">
198+
<NInput v-model:value="serverAuth" :placeholder="t('tools.html-to-pdf.texts.placeholder-username-password')" />
196199
</NFormItem>
197200
<n-p>
198-
You must self host HTML to PDF Service. See:
199-
<c-link href="https://github.com/sharevb/puppeteer-htmltopdf?tab=readme-ov-file#running-in-docker" target="_blank">
200-
HTML to PDF Service install
201+
{{ t('tools.html-to-pdf.texts.tag-you-must-self-host-html-to-pdf-service-see') }}<c-link href="https://github.com/sharevb/puppeteer-htmltopdf?tab=readme-ov-file#running-in-docker" target="_blank">
202+
{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-install') }}
201203
</c-link>
202204
</n-p>
203205
</n-card>
204206
</details>
205207

206208
<NTabs type="line">
207-
<NTabPane name="url" tab="URL → PDF">
209+
<NTabPane name="url" :tab="t('tools.html-to-pdf.texts.tab-url-pdf')">
208210
<NForm label-placement="left">
209-
<NFormItem label="URL:">
210-
<NInput v-model:value="url" placeholder="https://example.com" />
211+
<NFormItem :label="t('tools.html-to-pdf.texts.label-url')">
212+
<NInput v-model:value="url" :placeholder="t('tools.html-to-pdf.texts.placeholder-https-example-com')" />
211213
</NFormItem>
212214

213215
<n-space mb-2 justify="center">
@@ -217,7 +219,7 @@ async function generateBatch() {
217219
:disabled="isRunning"
218220
@click="generateFromUrl"
219221
>
220-
Generate PDF
222+
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
221223
</NButton>
222224
</n-space>
223225

@@ -227,9 +229,9 @@ async function generateBatch() {
227229
</NForm>
228230
</NTabPane>
229231

230-
<NTabPane name="html" tab="HTML → PDF">
232+
<NTabPane name="html" :tab="t('tools.html-to-pdf.texts.tab-html-pdf')">
231233
<NForm label-placement="top">
232-
<NFormItem label="HTML Content:">
234+
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-content')">
233235
<NInput
234236
v-model:value="html"
235237
type="textarea"
@@ -244,7 +246,7 @@ async function generateBatch() {
244246
:disabled="isRunning"
245247
@click="generateFromHtml"
246248
>
247-
Generate PDF
249+
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
248250
</NButton>
249251
</n-space>
250252

@@ -254,9 +256,9 @@ async function generateBatch() {
254256
</NForm>
255257
</NTabPane>
256258

257-
<NTabPane name="batch" tab="Batch URL → PDF">
259+
<NTabPane name="batch" :tab="t('tools.html-to-pdf.texts.tab-batch-url-pdf')">
258260
<NForm label-placement="top">
259-
<NFormItem label="URLs (one per line):">
261+
<NFormItem :label="t('tools.html-to-pdf.texts.label-urls-one-per-line')">
260262
<NInput
261263
v-model:value="batchUrls"
262264
type="textarea"
@@ -271,7 +273,7 @@ async function generateBatch() {
271273
:disabled="isBatchRunning"
272274
@click="generateBatch"
273275
>
274-
Generate PDFs
276+
{{ t('tools.html-to-pdf.texts.tag-generate-pdfs') }}
275277
</NButton>
276278
</n-space>
277279
</NForm>
@@ -289,11 +291,11 @@ async function generateBatch() {
289291
</div>
290292

291293
<!-- Results -->
292-
<NCard v-if="batchResults.length > 0" title="Results">
294+
<NCard v-if="batchResults.length > 0" :title="t('tools.html-to-pdf.texts.title-results')">
293295
<n-table>
294296
<thead>
295-
<th>Url</th>
296-
<th>Download</th>
297+
<th>{{ t('tools.html-to-pdf.texts.tag-url') }}</th>
298+
<th>{{ t('tools.html-to-pdf.texts.tag-download') }}</th>
297299
</thead>
298300
<tbody>
299301
<tr
@@ -311,13 +313,13 @@ async function generateBatch() {
311313
type="success"
312314
@click="downloadBlob(item.pdfBlob!, `${urlToFilename(item.url)}.pdf`)"
313315
>
314-
Download PDF
316+
{{ t('tools.html-to-pdf.texts.tag-download-pdf') }}
315317
</NButton>
316318
</template>
317319

318320
<template v-else>
319321
<NButton size="small" type="error" disabled>
320-
Failed
322+
{{ t('tools.html-to-pdf.texts.tag-failed') }}
321323
</NButton>
322324
<div style="color: red; font-size: 12px">
323325
{{ item.error }}
@@ -331,52 +333,52 @@ async function generateBatch() {
331333
</NTabPane>
332334

333335
<!-- Custom PDF Options -->
334-
<NTabPane name="custom-options" tab="Custom PDF Options">
336+
<NTabPane name="custom-options" :tab="t('tools.html-to-pdf.texts.tab-custom-pdf-options')">
335337
<NForm label-placement="left">
336-
<NFormItem label="Format:">
338+
<NFormItem :label="t('tools.html-to-pdf.texts.label-format')">
337339
<NSelect
338340
v-model:value="options.format"
339341
:options="pdfFormats"
340342
/>
341343
</NFormItem>
342344

343-
<NFormItem label="Language:">
344-
<NInput v-model:value="options.language" placeholder="en-US" />
345+
<NFormItem :label="t('tools.html-to-pdf.texts.label-language')">
346+
<NInput v-model:value="options.language" :placeholder="t('tools.html-to-pdf.texts.placeholder-en-us')" />
345347
</NFormItem>
346348

347349
<n-space justify="center">
348-
<NFormItem label="Landscape:">
350+
<NFormItem :label="t('tools.html-to-pdf.texts.label-landscape')">
349351
<NSwitch v-model:value="options.landscape" />
350352
</NFormItem>
351353

352-
<NFormItem label="One Long Page:">
354+
<NFormItem :label="t('tools.html-to-pdf.texts.label-one-long-page')">
353355
<NSwitch v-model:value="options.onePage" />
354356
</NFormItem>
355357

356-
<NFormItem label="Auto-Hide Cookie Banners:">
358+
<NFormItem :label="t('tools.html-to-pdf.texts.label-auto-hide-cookie-banners')">
357359
<NSwitch v-model:value="options.autoHideCookies" />
358360
</NFormItem>
359361

360-
<NFormItem label="Print Background:">
362+
<NFormItem :label="t('tools.html-to-pdf.texts.label-print-background')">
361363
<NSwitch v-model:value="options.printBackground" />
362364
</NFormItem>
363365
</n-space>
364366

365-
<c-card title="Margins">
367+
<c-card :title="t('tools.html-to-pdf.texts.title-margins')">
366368
<NSpace justify="center">
367-
<NFormItem label="Top (mm):" style="width: 200px">
369+
<NFormItem :label="t('tools.html-to-pdf.texts.label-top-mm')" style="width: 200px">
368370
<NInputNumber v-model:value="options.margin.top" />
369371
</NFormItem>
370372

371-
<NFormItem label="Bottom (mm):" style="width: 200px">
373+
<NFormItem :label="t('tools.html-to-pdf.texts.label-bottom-mm')" style="width: 200px">
372374
<NInputNumber v-model:value="options.margin.bottom" />
373375
</NFormItem>
374376

375-
<NFormItem label="Left (mm):" style="width: 200px">
377+
<NFormItem :label="t('tools.html-to-pdf.texts.label-left-mm')" style="width: 200px">
376378
<NInputNumber v-model:value="options.margin.left" />
377379
</NFormItem>
378380

379-
<NFormItem label="Right (mm):" style="width: 200px">
381+
<NFormItem :label="t('tools.html-to-pdf.texts.label-right-mm')" style="width: 200px">
380382
<NInputNumber v-model:value="options.margin.right" />
381383
</NFormItem>
382384
</NSpace>

src/tools/html-to-pdf/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
import { translate as t } from '@/plugins/i18n.plugin';
12
import { Printer } from '@vicons/tabler';
23
import { defineTool } from '../tool';
34

45
export const tool = defineTool({
5-
name: 'HTML to PDF',
6+
name: t('tools.html-to-pdf.title'),
67
path: '/html-to-pdf',
7-
description: 'Generate PDF from HTML content or URL with format selection and auto hide cookie banners',
8+
description: t('tools.html-to-pdf.description'),
89
keywords: ['html', 'url', 'pdf'],
910
component: () => import('./html-to-pdf.vue'),
1011
icon: Printer,
1112
createdAt: new Date('2026-04-07'),
1213
category: 'PDF',
13-
externAccessDescription: 'This tool sends URLs and HTML content to the *self hosted* Puppeteer webservice configured.',
14+
externAccessDescription: t('tools.html-to-pdf.externalAccess'),
1415
});

src/tools/shutdown-command-generator/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { translate as t } from '@/plugins/i18n.plugin';
12
import { SunOff } from '@vicons/tabler';
23
import { defineTool } from '../tool';
34

45
export const tool = defineTool({
5-
name: 'Shutdown Command Generator',
6+
name: t('tools.shutdown-command-generator.title'),
67
path: '/shutdown-command-generator',
7-
description: 'Generate shutdown command for various OS',
8+
description: t('tools.shutdown-command-generator.description'),
89
keywords: ['shutdown', 'command'],
910
component: () => import('./shutdown-command-generator.vue'),
1011
icon: SunOff,

src/tools/shutdown-command-generator/shutdown-command-generator.vue

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<script setup lang="ts">
2+
import { useI18n } from 'vue-i18n';
3+
4+
const { t } = useI18n();
25
type Platform = 'windows' | 'linux' | 'macos';
36
type Mode = 'delay' | 'time';
47
@@ -22,14 +25,14 @@ const cancel = ref(false);
2225
const hibernate = ref(false);
2326
2427
const platformOptions = [
25-
{ label: 'Windows', value: 'windows' },
26-
{ label: 'Linux', value: 'linux' },
27-
{ label: 'macOS', value: 'macos' },
28+
{ label: t('tools.shutdown-command-generator.texts.label-windows'), value: 'windows' },
29+
{ label: t('tools.shutdown-command-generator.texts.label-linux'), value: 'linux' },
30+
{ label: t('tools.shutdown-command-generator.texts.label-macos'), value: 'macos' },
2831
];
2932
3033
const modeOptions = [
31-
{ label: 'Delay', value: 'delay' },
32-
{ label: 'Specific Time', value: 'time' },
34+
{ label: t('tools.shutdown-command-generator.texts.label-delay'), value: 'delay' },
35+
{ label: t('tools.shutdown-command-generator.texts.label-specific-time'), value: 'time' },
3336
];
3437
3538
// --- Command Builders -------------------------------------------------------
@@ -167,7 +170,7 @@ const command = computed(() => {
167170
<c-select
168171
v-model:value="platform"
169172
:options="platformOptions"
170-
label="Platform:"
173+
:label="t('tools.shutdown-command-generator.texts.label-platform')"
171174
label-position="left"
172175
mb-1
173176
/>
@@ -185,27 +188,22 @@ const command = computed(() => {
185188
</NSpace>
186189

187190
<NSpace v-if="mode === 'delay'" justify="center" mb-1>
188-
<NFormItem label="Delay:" label-placement="left" mb-1>
191+
<NFormItem :label="t('tools.shutdown-command-generator.texts.label-delay')" label-placement="left" mb-1>
189192
<NInputNumber
190193
v-model:value="delayHours"
191194
:min="0"
192-
/>
193-
&nbsp;h&nbsp;
194-
<NInputNumber
195+
/>{{ t('tools.shutdown-command-generator.texts.tag-nbsp-h-nbsp') }}<NInputNumber
195196
v-model:value="delayMinutes"
196197
:min="0"
197-
/>
198-
&nbsp;m&nbsp;
199-
<NInputNumber
198+
/>{{ t('tools.shutdown-command-generator.texts.tag-nbsp-m-nbsp') }}<NInputNumber
200199
v-model:value="delaySeconds"
201200
:min="0"
202-
/>
203-
&nbsp;s
201+
/>{{ t('tools.shutdown-command-generator.texts.tag-nbsp-s') }}
204202
</NFormItem>
205203
</NSpace>
206204

207205
<NSpace v-if="mode === 'time'" justify="center" mb-1>
208-
<NFormItem label="Shutdown time:" label-placement="left">
206+
<NFormItem :label="t('tools.shutdown-command-generator.texts.label-shutdown-time')" label-placement="left">
209207
<NDatePicker
210208
v-model:value="timeValue"
211209
type="datetime"
@@ -214,14 +212,14 @@ const command = computed(() => {
214212
</NSpace>
215213

216214
<NSpace justify="center" mb-1>
217-
<NCheckbox v-model:checked="force" label="Force" />
218-
<NCheckbox v-model:checked="reboot" label="Reboot" />
219-
<NCheckbox v-model:checked="logoff" label="Logoff" />
220-
<NCheckbox v-model:checked="cancel" label="Cancel" />
221-
<NCheckbox v-model:checked="hibernate" label="Hibernate" />
215+
<NCheckbox v-model:checked="force" :label="t('tools.shutdown-command-generator.texts.label-force')" />
216+
<NCheckbox v-model:checked="reboot" :label="t('tools.shutdown-command-generator.texts.label-reboot')" />
217+
<NCheckbox v-model:checked="logoff" :label="t('tools.shutdown-command-generator.texts.label-logoff')" />
218+
<NCheckbox v-model:checked="cancel" :label="t('tools.shutdown-command-generator.texts.label-cancel')" />
219+
<NCheckbox v-model:checked="hibernate" :label="t('tools.shutdown-command-generator.texts.label-hibernate')" />
222220
</NSpace>
223221

224-
<c-card title="Generated command">
222+
<c-card :title="t('tools.shutdown-command-generator.texts.title-generated-command')">
225223
<textarea-copyable :value="command" language="bash" />
226224
</c-card>
227225
</div>

0 commit comments

Comments
 (0)