Merge pull request #1283 from danielaskdd/main

Add i18n translation for legend type
This commit is contained in:
Daniel.y
2025-04-06 23:54:43 +08:00
committed by GitHub
7 changed files with 128 additions and 59 deletions

File diff suppressed because one or more lines are too long

View File

@@ -8,7 +8,7 @@
<link rel="icon" type="image/svg+xml" href="logo.png" /> <link rel="icon" type="image/svg+xml" href="logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lightrag</title> <title>Lightrag</title>
<script type="module" crossorigin src="/webui/assets/index-sAkGsjRM.js"></script> <script type="module" crossorigin src="/webui/assets/index-CAYmcaJK.js"></script>
<link rel="stylesheet" crossorigin href="/webui/assets/index-QU59h9JG.css"> <link rel="stylesheet" crossorigin href="/webui/assets/index-QU59h9JG.css">
</head> </head>
<body> <body>

View File

@@ -4,6 +4,21 @@ import { useGraphStore } from '@/stores/graph'
import { Card } from '@/components/ui/Card' import { Card } from '@/components/ui/Card'
import { ScrollArea } from '@/components/ui/ScrollArea' import { ScrollArea } from '@/components/ui/ScrollArea'
// Predefined node types list
const PREDEFINED_TYPES = [
'person',
'category',
'geo',
'location',
'organization',
'event',
'equipment',
'weapon',
'animal',
'unknown',
'technology'
]
interface LegendProps { interface LegendProps {
className?: string className?: string
} }
@@ -28,7 +43,9 @@ const Legend: React.FC<LegendProps> = ({ className }) => {
style={{ backgroundColor: color }} style={{ backgroundColor: color }}
/> />
<span className="text-xs truncate" title={type}> <span className="text-xs truncate" title={type}>
{type} {PREDEFINED_TYPES.includes(type.toLowerCase())
? t(`graphPanel.nodeTypes.${type.toLowerCase()}`)
: type}
</span> </span>
</div> </div>
))} ))}

View File

@@ -143,6 +143,19 @@
"title": "إعدادات خادم LightRAG" "title": "إعدادات خادم LightRAG"
}, },
"legend": "المفتاح", "legend": "المفتاح",
"nodeTypes": {
"person": "شخص",
"category": "فئة",
"geo": "كيان جغرافي",
"location": "موقع",
"organization": "منظمة",
"event": "حدث",
"equipment": "معدات",
"weapon": "سلاح",
"animal": "حيوان",
"unknown": "غير معروف",
"technology": "العلوم"
},
"sideBar": { "sideBar": {
"settings": { "settings": {
"settings": "الإعدادات", "settings": "الإعدادات",

View File

@@ -143,6 +143,19 @@
"title": "LightRAG Server Settings" "title": "LightRAG Server Settings"
}, },
"legend": "Legend", "legend": "Legend",
"nodeTypes": {
"person": "Person",
"category": "Category",
"geo": "Geographic",
"location": "Location",
"organization": "Organization",
"event": "Event",
"equipment": "Equipment",
"weapon": "Weapon",
"animal": "Animal",
"unknown": "Unknown",
"technology": "Technology"
},
"sideBar": { "sideBar": {
"settings": { "settings": {
"settings": "Settings", "settings": "Settings",

View File

@@ -143,6 +143,19 @@
"title": "Paramètres du Serveur LightRAG" "title": "Paramètres du Serveur LightRAG"
}, },
"legend": "Légende", "legend": "Légende",
"nodeTypes": {
"person": "Personne",
"category": "Catégorie",
"geo": "Géographique",
"location": "Emplacement",
"organization": "Organisation",
"event": "Événement",
"equipment": "Équipement",
"weapon": "Arme",
"animal": "Animal",
"unknown": "Inconnu",
"technology": "Technologie"
},
"sideBar": { "sideBar": {
"settings": { "settings": {
"settings": "Paramètres", "settings": "Paramètres",

View File

@@ -143,6 +143,19 @@
"title": "LightRAG 服务器设置" "title": "LightRAG 服务器设置"
}, },
"legend": "图例", "legend": "图例",
"nodeTypes": {
"person": "人物",
"category": "类别",
"geo": "地理名称",
"location": "位置",
"organization": "组织机构",
"event": "事件",
"equipment": "装备",
"weapon": "武器",
"animal": "动物",
"unknown": "未知",
"technology": "技术"
},
"sideBar": { "sideBar": {
"settings": { "settings": {
"settings": "设置", "settings": "设置",