mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
feat(Tiptap): add internationalization support for word and length display in multiple languages
This commit is contained in:
@@ -5,6 +5,7 @@ import { Markdown } from 'tiptap-markdown'
|
||||
import Placeholder from '@tiptap/extension-placeholder'
|
||||
import { cx } from 'class-variance-authority'
|
||||
import countWords from '@/lib/countWords'
|
||||
const { t } = useI18n()
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue?: string
|
||||
@@ -64,6 +65,6 @@ onUnmounted(() => {
|
||||
v-if="modelValue?.length && modelValue?.length > 0"
|
||||
class="absolute bottom-2 right-3 flex justify-end px-2 py-1 text-xs text-gray-400 select-none bg-white rounded-md"
|
||||
>
|
||||
{{ `${modelValue?.length ?? 0} 长度 · ${countWords(modelValue ?? '')} 字符` }}
|
||||
{{ `${modelValue?.length ?? 0} ${t('common.length')} · ${countWords(modelValue ?? '')} ${t('common.words')}` }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "Hinzufügen",
|
||||
"copySuccess": "Erfolgreich kopiert"
|
||||
"copySuccess": "Erfolgreich kopiert",
|
||||
"length": "Länge",
|
||||
"words": "Wörter"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "Add",
|
||||
"copySuccess": "Copy Success"
|
||||
"copySuccess": "Copy Success",
|
||||
"length": "length",
|
||||
"words": "words"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "Ajouter",
|
||||
"copySuccess": "Copié avec succès"
|
||||
"copySuccess": "Copié avec succès",
|
||||
"length": "longueur",
|
||||
"words": "mots"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "追加",
|
||||
"copySuccess": "コピーしました"
|
||||
"copySuccess": "コピーしました",
|
||||
"length": "長さ",
|
||||
"words": "文字"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "추가",
|
||||
"copySuccess": "복사되었습니다"
|
||||
"copySuccess": "복사되었습니다",
|
||||
"length": "길이",
|
||||
"words": "단어"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "添加",
|
||||
"copySuccess": "复制成功"
|
||||
"copySuccess": "复制成功",
|
||||
"length": "长度",
|
||||
"words": "字符"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "新增",
|
||||
"copySuccess": "複製成功"
|
||||
"copySuccess": "複製成功",
|
||||
"length": "長度",
|
||||
"words": "字符"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
Reference in New Issue
Block a user