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
search:
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:
categories:
favorite-tools: Deine Lieblingstools
@ -553,4 +566,4 @@ tools:
multiline: Ermöglicht die Übereinstimmung von ^ und $ neben Zeilenumbruchzeichen.
dotAll: Lässt . als Treffer für Zeilenumbruchzeichen zu.
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
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:
categories:
favorite-tools: Your favorite tools

View file

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

View file

@ -1,13 +1,14 @@
<script setup lang="ts">
import { useVModel } from '@vueuse/core';
import { useCopy } from '@/composable/copy';
import { translate as t } from '@/plugins/i18n.plugin';
const props = defineProps<{ value: string }>();
const emit = defineEmits(['update:value']);
const value = useVModel(props, 'value', emit);
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>
<template>

View file

@ -1,13 +1,14 @@
<script setup lang="ts">
import { useCopy } from '@/composable/copy';
import { translate as t } from '@/plugins/i18n.plugin';
const props = withDefaults(defineProps<{ value?: string }>(), { value: '' });
const { value } = toRefs(props);
const initialText = 'Copy to clipboard';
const initialText = t('spanCopyable.copy');
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>
<template>

View file

@ -9,6 +9,7 @@ import yamlHljs from 'highlight.js/lib/languages/yaml';
import iniHljs from 'highlight.js/lib/languages/ini';
import markdownHljs from 'highlight.js/lib/languages/markdown';
import { useCopy } from '@/composable/copy';
import { translate as t } from '@/plugins/i18n.plugin';
const props = withDefaults(
defineProps<{
@ -22,7 +23,7 @@ const props = withDefaults(
followHeightOf: null,
language: 'txt',
copyPlacement: 'top-right',
copyMessage: 'Copy to clipboard',
copyMessage: t('textareaCopyable.copy'),
},
);
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 { 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>
<template>