(t: ReturnType<typeof useT>, raw: string)
| 940 | // 把节点 type 原始值(concept/entity/source_summary/...)映射为界面语言下的显示文案; |
| 941 | // 表里没有对应 type.* 时回退到原始值(与 WikiTree 的渲染口径一致;底层 schema 值不变)。 |
| 942 | function localizeType(t: ReturnType<typeof useT>, raw: string): string { |
| 943 | const key = `type.${raw}`; |
| 944 | const out = t(key as never); |
| 945 | return out === key ? raw : out; |
| 946 | } |
| 947 | |
| 948 | // 关系类型显示名翻译(找不到键则回退到原始 token,如自定义别名) |
| 949 | function localizeRelation(t: ReturnType<typeof useT>, raw: string): string { |