mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-07 14:57:12 -04:00
WIP(translate): translate two category all tools
This commit is contained in:
parent
9db4b41daf
commit
4f550a9499
58 changed files with 708 additions and 172 deletions
|
@ -1,10 +1,11 @@
|
|||
import { List } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'JSON to CSV',
|
||||
name: t('tools.json-to-csv.title'),
|
||||
path: '/json-to-csv',
|
||||
description: 'Convert JSON to CSV with automatic header detection.',
|
||||
description: t('tools.json-to-csv.description'),
|
||||
keywords: ['json', 'to', 'csv', 'convert'],
|
||||
component: () => import('./json-to-csv.vue'),
|
||||
icon: List,
|
||||
|
|
|
@ -13,19 +13,20 @@ function transformer(value: string) {
|
|||
}, '');
|
||||
}
|
||||
|
||||
const { t } = useI18n();
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
message: t('tools.json-to-csv.invalidMessage'),
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<format-transformer
|
||||
input-label="Your raw JSON"
|
||||
input-placeholder="Paste your raw JSON here..."
|
||||
output-label="CSV version of your JSON"
|
||||
:input-label="t('tools.json-to-csv.inputLabel')"
|
||||
:input-placeholder="t('tools.json-to-csv.inputPlaceholder')"
|
||||
:output-label="t('tools.json-to-csv.outputLabel')"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
/>
|
||||
|
|
10
src/tools/json-to-csv/locales/en.yml
Normal file
10
src/tools/json-to-csv/locales/en.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
tools:
|
||||
json-to-csv:
|
||||
title: JSON to CSV
|
||||
description: Convert JSON to CSV with automatic header detection.
|
||||
|
||||
inputLabel: Your raw JSON
|
||||
inputPlaceholder: Paste your raw JSON here...
|
||||
outputLabel: CSV version of your JSON
|
||||
|
||||
invalidMessage: Provided JSON is not valid.
|
10
src/tools/json-to-csv/locales/zh.yml
Normal file
10
src/tools/json-to-csv/locales/zh.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
tools:
|
||||
json-to-csv:
|
||||
title: JSON 转换为 CSV
|
||||
description: 将 JSON 转换为 CSV,并自动检测标题。
|
||||
|
||||
inputLabel: 您的原始 JSON
|
||||
inputPlaceholder: 在此粘贴您的原始 JSON...
|
||||
outputLabel: 您的 JSON 的 CSV 版本
|
||||
|
||||
invalidMessage: 提供的 JSON 不是有效的。
|
Loading…
Add table
Add a link
Reference in a new issue