MCPcopy Create free account
hub / github.com/Qinbf/groundmap / localizeType

Function localizeType

web/components/GraphView.tsx:942–946  ·  view source on GitHub ↗
(t: ReturnType<typeof useT>, raw: string)

Source from the content-addressed store, hash-verified

940// 把节点 type 原始值(concept/entity/source_summary/...)映射为界面语言下的显示文案;
941// 表里没有对应 type.* 时回退到原始值(与 WikiTree 的渲染口径一致;底层 schema 值不变)。
942function 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,如自定义别名)
949function localizeRelation(t: ReturnType<typeof useT>, raw: string): string {

Callers 2

HoverCardFunction · 0.85
LegendFunction · 0.85

Calls 1

tFunction · 0.50

Tested by

no test coverage detected