diff --git a/locales/de.yml b/locales/de.yml index 6d39812c..2d75385b 100644 --- a/locales/de.yml +++ b/locales/de.yml @@ -78,9 +78,6 @@ toolCard: new: Neu search: label: Suche -copyClipboard: - tooltip: In die Zwischenablage kopieren - success: Kopiert! tools: categories: favorite-tools: Deine Lieblingstools diff --git a/locales/en.yml b/locales/en.yml index d8f0c61d..5baceff1 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -72,9 +72,6 @@ toolCard: new: New search: label: Search -copyClipboard: - tooltip: Copy to clipboard - success: Copied! tools: categories: favorite-tools: Your favorite tools diff --git a/src/components/TextareaCopyable.vue b/src/components/TextareaCopyable.vue index ca76ccb2..9585177d 100644 --- a/src/components/TextareaCopyable.vue +++ b/src/components/TextareaCopyable.vue @@ -10,21 +10,21 @@ import iniHljs from 'highlight.js/lib/languages/ini'; import markdownHljs from 'highlight.js/lib/languages/markdown'; import { useCopy } from '@/composable/copy'; -const props = defineProps<{ - value: string - followHeightOf?: HTMLElement | null - language?: string - copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none' - copyMessage?: string -}>(); -const { t } = useI18n(); -const defaultProps = withDefaults(props, { - followHeightOf: null, - language: 'txt', - copyPlacement: 'top-right', - copyMessage: t('copyClipboard.tooltip'), -}); - +const props = withDefaults( + defineProps<{ + value: string + followHeightOf?: HTMLElement | null + language?: string + copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none' + copyMessage?: string + }>(), + { + followHeightOf: null, + language: 'txt', + copyPlacement: 'top-right', + copyMessage: 'Copy to clipboard', + }, +); hljs.registerLanguage('sql', sqlHljs); hljs.registerLanguage('json', jsonHljs); hljs.registerLanguage('html', xmlHljs); @@ -37,7 +37,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 ? t('copyClipboard.success') : copyMessage.value); +const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.value);