mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-27 16:09:01 +03:00
Feat/translate all content (#121)
* feat: add script to extract strings * feat: extract many strings (html, attr, label) * feat(extract string): extract html only for .vue and single file mode * fix: __i18n_ally_root__ * feat: nestify en.yml + extract tab attributes * feat: add script to extract strings * feat: extract many strings (html, attr, label) * feat(extract string): extract html only for .vue and single file mode * fix: __i18n_ally_root__ * feat: nestify en.yml + extract tab attributes * fix: lint * feat: add vue-i18n-extract to check missing keys * fix: unit tests * fix: update vue i18n plugin
This commit is contained in:
1 parent
0d4267e356
commit
a8c6ebc81b
347 files changed
+10245
-4533
No files matched your search
@@ -1,9 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import jsonar from 'jsonar-mod';
|
||||
import JSON5 from 'json5';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import { withDefaultOnError } from '@/utils/defaults';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const defaultValue = `{
|
||||
a:"b",
|
||||
arr: [1, "2"],
|
||||
@@ -19,17 +22,17 @@ function transformer(value: string) {
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
message: t('tools.json-to-php-array.texts.message-provided-json-is-not-valid'),
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<format-transformer
|
||||
input-label="Your JSON"
|
||||
:input-label="t('tools.json-to-php-array.texts.input-label-your-json')"
|
||||
:input-default="defaultValue"
|
||||
input-placeholder="Paste your JSON here..."
|
||||
output-label="PHP Array version"
|
||||
:input-placeholder="t('tools.json-to-php-array.texts.input-placeholder-paste-your-json-here')"
|
||||
:output-label="t('tools.json-to-php-array.texts.output-label-php-array-version')"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user