feat(i18n): add 'add' translation in multiple languages and update InputGroupField, KvInputGroupField, and NotifyConfigField components to use localized text for button labels

This commit is contained in:
keven1024
2026-05-01 21:28:31 +08:00
parent 833079d495
commit f4a28e369f
10 changed files with 12 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ const props = defineProps<{
label?: string
rules?: RuleExpression<string[]>
}>()
const { t } = useI18n()
const { value, setValue, errorMessage } = useField<string[]>(props.name, props?.rules)
</script>
@@ -30,7 +31,7 @@ const { value, setValue, errorMessage } = useField<string[]>(props.name, props?.
</div>
<Button class="self-start" size="sm" @click="() => setValue([...(value || []), ''])">
<LucidePlus class="size-4" />
添加
{{ t('common.add') }}
</Button>
</div>
</template>

View File

@@ -31,6 +31,7 @@ const props = defineProps<{
config?: KvInputConfig
}>()
const { t } = useI18n()
const config = computed(() => {
return {
key: { ...defaultConfig.key, ...(props.config?.key ?? {}) },
@@ -95,7 +96,7 @@ const updateKey = (index: number, nextKey: string | number) => {
</div>
<Button type="button" class="self-start" size="sm" @click="() => setValue([...(value ?? []), ['', '']])">
<LucidePlus class="size-4" />
添加
{{ t('common.add') }}
</Button>
</div>
</template>

View File

@@ -170,7 +170,7 @@ const expandedAdvanced = ref<Set<number>>(new Set())
"
>
<LucidePlus class="size-4" />
添加
{{ t('common.add') }}
</Button>
</div>
</div>

View File

@@ -37,6 +37,7 @@
"backToHome": "Zurück zur Startseite"
},
"common": {
"add": "Hinzufügen",
"copySuccess": "Erfolgreich kopiert"
},
"page": {

View File

@@ -37,6 +37,7 @@
"backToHome": "Back to Home"
},
"common": {
"add": "Add",
"copySuccess": "Copy Success"
},
"page": {

View File

@@ -37,6 +37,7 @@
"backToHome": "Retour à l'accueil"
},
"common": {
"add": "Ajouter",
"copySuccess": "Copié avec succès"
},
"page": {

View File

@@ -37,6 +37,7 @@
"backToHome": "ホームに戻る"
},
"common": {
"add": "追加",
"copySuccess": "コピーしました"
},
"page": {

View File

@@ -37,6 +37,7 @@
"backToHome": "홈으로 돌아가기"
},
"common": {
"add": "추가",
"copySuccess": "복사되었습니다"
},
"page": {

View File

@@ -37,6 +37,7 @@
"backToHome": "返回首页"
},
"common": {
"add": "添加",
"copySuccess": "复制成功"
},
"page": {

View File

@@ -37,6 +37,7 @@
"backToHome": "返回首頁"
},
"common": {
"add": "新增",
"copySuccess": "複製成功"
},
"page": {