feat: i18n for choice prompt via promptKey, with fallback

This commit is contained in:
2026-06-10 16:51:50 +08:00
parent 879501ccb5
commit 03c4ee3a65
6 changed files with 22 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ function handleChoose(index: number) {
if (!choiceEnabled.value) return
const choice = props.choices[index]
if (choice?.prompt) {
emit('prompt', choice.prompt)
emit('prompt', t(choice.promptKey || choice.prompt))
}
emit('choose', index)
}