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>