WIP(translate): translate two category all tools

This commit is contained in:
Amery2010 2024-02-19 17:38:30 +08:00
parent 9db4b41daf
commit 4f550a9499
58 changed files with 708 additions and 172 deletions

View file

@ -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"
/>