(value: string | undefined, locale: Locale)
| 121 | |
| 122 | // 翻译 type/status/confidence 字段值(fallback 到原值) |
| 123 | export function tType(value: string | undefined, locale: Locale): string { |
| 124 | if (!value) return t("type.unknown", locale); |
| 125 | const key = `type.${value}` as TranslationKey; |
| 126 | const translated = t(key, locale); |
| 127 | return translated === key ? value : translated; |
| 128 | } |
| 129 | |
| 130 | export function tStatus(value: string | undefined, locale: Locale): string { |
| 131 | if (!value) return t("status.draft", locale); |
no test coverage detected