Add translations support (#116)

This commit is contained in:
Sasha Sorokin
2023-11-11 23:03:58 +01:00
committed by GitHub
parent 1c18563dfb
commit 591ce0894e
11 changed files with 838 additions and 130 deletions

View File

@@ -1,5 +1,5 @@
<template>
<button class="code" :class="{ copied }" title="Copy code to clipboard" @click="copyText">
<button class="code" :class="{ copied }" :title="formatMessage(copiedMessage)" @click="copyText">
<span>{{ text }}</span>
<CheckIcon v-if="copied" />
<ClipboardCopyIcon v-else />
@@ -8,6 +8,12 @@
<script setup>
import { CheckIcon, ClipboardCopyIcon } from '@'
import { useVIntl, defineMessage } from '@vintl/vintl'
const copiedMessage = defineMessage({
id: 'omorphia.component.copy.action.copy',
defaultMessage: 'Copy code to clipboard',
})
const { formatMessage } = useVIntl()
</script>
<script>