Translate common property names to Chinese

This commit is contained in:
yangdx
2025-03-14 01:56:10 +08:00
parent 496a208bf9
commit c9c9f3d911
5 changed files with 42 additions and 20 deletions

View File

@@ -132,11 +132,19 @@ const PropertyRow = ({
onClick?: () => void
tooltip?: string
}) => {
const { t } = useTranslation()
const getPropertyNameTranslation = (name: string) => {
const translationKey = `graphPanel.propertiesView.node.propertyNames.${name}`
const translation = t(translationKey)
return translation === translationKey ? name : translation
}
return (
<div className="flex items-center gap-2">
<label className="text-primary/60 tracking-wide">{name}</label>:
<label className="text-primary/60 tracking-wide whitespace-nowrap">{getPropertyNameTranslation(name)}</label>:
<Text
className="hover:bg-primary/20 rounded p-1 text-ellipsis"
className="hover:bg-primary/20 rounded p-1 overflow-hidden text-ellipsis"
tooltipClassName="max-w-80"
text={value}
tooltip={tooltip || (typeof value === 'string' ? value : JSON.stringify(value, null, 2))}

View File

@@ -150,7 +150,14 @@
"labels": "Labels",
"degree": "Degree",
"properties": "Properties",
"relationships": "Relationships"
"relationships": "Relationships",
"propertyNames": {
"description": "Description",
"entity_id": "Name",
"entity_type": "Type",
"source_id": "SrcID",
"Neighbour": "Neigh"
}
},
"edge": {
"title": "Relationship",

View File

@@ -147,7 +147,14 @@
"labels": "标签",
"degree": "度数",
"properties": "属性",
"relationships": "关系"
"relationships": "关系",
"propertyNames": {
"description": "描述",
"entity_id": "名称",
"entity_type": "类型",
"source_id": "信源ID",
"Neighbour": "邻接"
}
},
"edge": {
"title": "关系",