This commit is contained in:
steffenrapp 2024-09-21 09:30:17 +00:00
parent 563900dc11
commit e3992d9187
6 changed files with 39 additions and 9 deletions

View file

@ -78,6 +78,19 @@ toolCard:
new: Neu new: Neu
search: search:
label: Suche label: Suche
textareaCopyable:
copy: In die Zwischenablage kopieren
copied: Kopiert!
spanCopyable:
copy: In die Zwischenablage kopieren
copied: Kopiert!
inputCopyable:
copy: In die Zwischenablage kopieren
copied: Kopiert!
formatTransformer:
input: Eingabe
input-placeholder: Eingabe...
output: Ausgabe
tools: tools:
categories: categories:
favorite-tools: Deine Lieblingstools favorite-tools: Deine Lieblingstools
@ -553,4 +566,4 @@ tools:
multiline: Ermöglicht die Übereinstimmung von ^ und $ neben Zeilenumbruchzeichen. multiline: Ermöglicht die Übereinstimmung von ^ und $ neben Zeilenumbruchzeichen.
dotAll: Lässt . als Treffer für Zeilenumbruchzeichen zu. dotAll: Lässt . als Treffer für Zeilenumbruchzeichen zu.
unicode: Unicode; behandelt ein Muster als eine Folge von Unicode-Codepunkten. unicode: Unicode; behandelt ein Muster als eine Folge von Unicode-Codepunkten.
unicodeSets: Ein Upgrade zum U-Modus mit mehr Unicode-Funktionen. unicodeSets: Ein Upgrade zum u-Modus mit mehr Unicode-Funktionen.

View file

@ -72,6 +72,19 @@ toolCard:
new: New new: New
search: search:
label: Search label: Search
textareaCopyable:
copy: Copy to clipboard
copied: Copied!
spanCopyable:
copy: Copy to clipboard
copied: Copied!
inputCopyable:
copy: Copy to clipboard
copied: Copied!
formatTransformer:
input: Input
input-placeholder: Input...
output: Output
tools: tools:
categories: categories:
favorite-tools: Your favorite tools favorite-tools: Your favorite tools

View file

@ -2,6 +2,7 @@
import _ from 'lodash'; import _ from 'lodash';
import type { UseValidationRule } from '@/composable/validation'; import type { UseValidationRule } from '@/composable/validation';
import CInputText from '@/ui/c-input-text/c-input-text.vue'; import CInputText from '@/ui/c-input-text/c-input-text.vue';
import { translate as t } from '@/plugins/i18n.plugin';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -16,10 +17,10 @@ const props = withDefaults(
{ {
transformer: _.identity, transformer: _.identity,
inputValidationRules: () => [], inputValidationRules: () => [],
inputLabel: 'Input', inputLabel: t('formatTransformer.input'),
inputDefault: '', inputDefault: '',
inputPlaceholder: 'Input...', inputPlaceholder: t('formatTransformer.input-placeholder'),
outputLabel: 'Output', outputLabel: t('formatTransformer.output'),
outputLanguage: '', outputLanguage: '',
}, },
); );

View file

@ -1,13 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { useCopy } from '@/composable/copy'; import { useCopy } from '@/composable/copy';
import { translate as t } from '@/plugins/i18n.plugin';
const props = defineProps<{ value: string }>(); const props = defineProps<{ value: string }>();
const emit = defineEmits(['update:value']); const emit = defineEmits(['update:value']);
const value = useVModel(props, 'value', emit); const value = useVModel(props, 'value', emit);
const { copy, isJustCopied } = useCopy({ source: value, createToast: false }); const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : 'Copy to clipboard'); const tooltipText = computed(() => isJustCopied.value ? t('inputCopyable.copied') : t('inputCopyable.copy'));
</script> </script>
<template> <template>

View file

@ -1,13 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
import { useCopy } from '@/composable/copy'; import { useCopy } from '@/composable/copy';
import { translate as t } from '@/plugins/i18n.plugin';
const props = withDefaults(defineProps<{ value?: string }>(), { value: '' }); const props = withDefaults(defineProps<{ value?: string }>(), { value: '' });
const { value } = toRefs(props); const { value } = toRefs(props);
const initialText = 'Copy to clipboard'; const initialText = t('spanCopyable.copy');
const { copy, isJustCopied } = useCopy({ source: value, createToast: false }); const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : initialText); const tooltipText = computed(() => isJustCopied.value ? t('spanCopyable.copied') : initialText);
</script> </script>
<template> <template>

View file

@ -9,6 +9,7 @@ import yamlHljs from 'highlight.js/lib/languages/yaml';
import iniHljs from 'highlight.js/lib/languages/ini'; import iniHljs from 'highlight.js/lib/languages/ini';
import markdownHljs from 'highlight.js/lib/languages/markdown'; import markdownHljs from 'highlight.js/lib/languages/markdown';
import { useCopy } from '@/composable/copy'; import { useCopy } from '@/composable/copy';
import { translate as t } from '@/plugins/i18n.plugin';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -22,7 +23,7 @@ const props = withDefaults(
followHeightOf: null, followHeightOf: null,
language: 'txt', language: 'txt',
copyPlacement: 'top-right', copyPlacement: 'top-right',
copyMessage: 'Copy to clipboard', copyMessage: t('textareaCopyable.copy'),
}, },
); );
hljs.registerLanguage('sql', sqlHljs); hljs.registerLanguage('sql', sqlHljs);
@ -37,7 +38,7 @@ const { value, language, followHeightOf, copyPlacement, copyMessage } = toRefs(p
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) }; const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
const { copy, isJustCopied } = useCopy({ source: value, createToast: false }); const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.value); const tooltipText = computed(() => isJustCopied.value ? t('textareaCopyable.copied') : copyMessage.value);
</script> </script>
<template> <template>