Merge pull request #1310 from danielaskdd/main
Add fallback support for translation missing
This commit is contained in:
File diff suppressed because one or more lines are too long
2
lightrag/api/webui/index.html
generated
2
lightrag/api/webui/index.html
generated
@@ -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-Ctzoea9d.js"></script>
|
<script type="module" crossorigin src="/webui/assets/index-1f7er6cN.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/webui/assets/index-CTB4Vp_z.css">
|
<link rel="stylesheet" crossorigin href="/webui/assets/index-CTB4Vp_z.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@@ -4,23 +4,6 @@ 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',
|
|
||||||
'object',
|
|
||||||
'group',
|
|
||||||
'technology',
|
|
||||||
]
|
|
||||||
|
|
||||||
interface LegendProps {
|
interface LegendProps {
|
||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
@@ -45,9 +28,7 @@ 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}>
|
||||||
{PREDEFINED_TYPES.includes(type.toLowerCase())
|
{t(`graphPanel.nodeTypes.${type.toLowerCase()}`, type)}
|
||||||
? t(`graphPanel.nodeTypes.${type.toLowerCase()}`)
|
|
||||||
: type}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
@@ -29,11 +29,14 @@ i18n
|
|||||||
fr: { translation: fr },
|
fr: { translation: fr },
|
||||||
ar: { translation: ar }
|
ar: { translation: ar }
|
||||||
},
|
},
|
||||||
lng: getStoredLanguage(), // 使用存储的语言设置
|
lng: getStoredLanguage(), // Use stored language settings
|
||||||
fallbackLng: 'en',
|
fallbackLng: 'en',
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false
|
escapeValue: false
|
||||||
}
|
},
|
||||||
|
// Configuration to handle missing translations
|
||||||
|
returnEmptyString: false,
|
||||||
|
returnNull: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Subscribe to language changes
|
// Subscribe to language changes
|
||||||
|
@@ -145,8 +145,8 @@
|
|||||||
},
|
},
|
||||||
"legend": "图例",
|
"legend": "图例",
|
||||||
"nodeTypes": {
|
"nodeTypes": {
|
||||||
"person": "人物",
|
"person": "人物角色",
|
||||||
"category": "类别",
|
"category": "分类",
|
||||||
"geo": "地理名称",
|
"geo": "地理名称",
|
||||||
"location": "位置",
|
"location": "位置",
|
||||||
"organization": "组织机构",
|
"organization": "组织机构",
|
||||||
|
Reference in New Issue
Block a user