Each package ships its zh/en dictionaries as satisfies-typed pairs (zh is the key-set source of truth; en is checked complete against it), merges its namespace into LocaleNamespaceMap, and declares locale: NS at register — components read the framework-injected typed t seat instead of a hand-carried inject member. Overlapping verbatim words (retry, submit, submitting) drop out of package dictionaries in favor of the shared common vocabulary; the question composer stores validation feedback as dictionary keys so shown feedback follows a locale switch.
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
/** `question` namespace dictionaries. */
|
|
|
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
export const zh = {
|
|
'error.incomplete': '请先完成这道问题。',
|
|
'error.unanswered': '请选择一个选项或填写自定义答案。',
|
|
'title.multi': '可多选',
|
|
'nav.prev': '上一题',
|
|
'nav.next': '下一题',
|
|
'nav.cancel': '放弃整组问题',
|
|
'option.recommended': '推荐',
|
|
'option.custom': '其他,请填写自定义答案',
|
|
'custom.placeholder': '输入你的答案',
|
|
'action.skip': '跳过本题',
|
|
'action.next': '下一题',
|
|
} satisfies Record<string, string>
|
|
|
|
/** The question namespace key union. */
|
|
export type QuestionKey = keyof typeof zh
|
|
|
|
/** English dictionary, checked complete against the zh key set. */
|
|
export const en = {
|
|
'error.incomplete': 'Please complete this question first.',
|
|
'error.unanswered': 'Please select an option or enter a custom answer.',
|
|
'title.multi': 'Multi-select',
|
|
'nav.prev': 'Previous question',
|
|
'nav.next': 'Next question',
|
|
'nav.cancel': 'Dismiss all questions',
|
|
'option.recommended': 'Recommended',
|
|
'option.custom': 'Other — enter a custom answer',
|
|
'custom.placeholder': 'Type your answer',
|
|
'action.skip': 'Skip this question',
|
|
'action.next': 'Next',
|
|
} satisfies Record<QuestionKey, string>
|