前端多语言翻译自动优先匹配对应的 PageType 名称的翻译,不需要在前端源代码里面手动设置 context

This commit is contained in:
jingrow 2026-04-20 20:30:12 +08:00
parent abeabdab76
commit 9f9ec444a6
4 changed files with 17 additions and 17 deletions

View File

@ -649,13 +649,13 @@ function getSelectOptions(field: any) {
//
if (dynamicFieldOptions.value[field.fieldname]) {
const options = dynamicFieldOptions.value[field.fieldname]
return options.map((opt: string) => ({ label: t(opt), value: opt }))
return options.map((opt: string) => ({ label: t(opt, {}, entity.value), value: opt }))
}
// 使
if (!field.options) return []
const staticOptions = field.options.split('\n').filter((s: string) => s.trim() !== '')
return staticOptions.map((opt: string) => ({ label: t(opt), value: opt }))
return staticOptions.map((opt: string) => ({ label: t(opt, {}, entity.value), value: opt }))
}
//

View File

@ -346,13 +346,13 @@ function getSelectOptions(field: any) {
//
if (dynamicFieldOptions.value[field.fieldname]) {
const options = dynamicFieldOptions.value[field.fieldname]
return options.map((opt: string) => ({ label: t(opt), value: opt }))
return options.map((opt: string) => ({ label: t(opt, {}, entity.value), value: opt }))
}
// 使
if (!field.options) return []
const staticOptions = field.options.split('\n').filter((s: string) => s.trim() !== '')
return staticOptions.map((opt: string) => ({ label: t(opt), value: opt }))
return staticOptions.map((opt: string) => ({ label: t(opt, {}, entity.value), value: opt }))
}
// Date

View File

@ -677,7 +677,7 @@ function getTabSections(tab: any) {
function getSelectOptions(field: any) {
if (!field.options) return []
const options = field.options.split('\n').filter((s: string) => s.trim() !== '')
return options.map((opt: string) => ({ label: t(opt), value: opt }))
return options.map((opt: string) => ({ label: t(opt, {}, entity.value), value: opt }))
}
//

View File

@ -35693,51 +35693,51 @@ msgid "Reference"
msgstr "关联"
# Activity Type options
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Call"
msgstr "电话"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Email"
msgstr "邮件"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Meeting"
msgstr "会议"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Note"
msgstr "备注"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Task"
msgstr "任务"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Reminder"
msgstr "提醒"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Follow-up"
msgstr "跟进"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Milestone"
msgstr "里程碑"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Decision"
msgstr "决策"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Update"
msgstr "更新"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Issue"
msgstr "问题"
msgctxt "Activity Type"
msgctxt "Activity"
msgid "Feedback"
msgstr "反馈"