yangdx
commited on
Commit
·
da5b7be
1
Parent(s):
402ce00
Add translations for API Key Alert component
Browse files
lightrag_webui/src/components/ApiKeyAlert.tsx
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import { useState, useCallback, useEffect } from 'react'
|
|
|
2 |
import {
|
3 |
AlertDialog,
|
4 |
AlertDialogContent,
|
@@ -18,6 +19,7 @@ interface ApiKeyAlertProps {
|
|
18 |
}
|
19 |
|
20 |
const ApiKeyAlert = ({ open: opened, onOpenChange: setOpened }: ApiKeyAlertProps) => {
|
|
|
21 |
const apiKey = useSettingsStore.use.apiKey()
|
22 |
const [tempApiKey, setTempApiKey] = useState<string>('')
|
23 |
const message = useBackendState.use.message()
|
@@ -50,9 +52,9 @@ const ApiKeyAlert = ({ open: opened, onOpenChange: setOpened }: ApiKeyAlertProps
|
|
50 |
<AlertDialog open={opened} onOpenChange={setOpened}>
|
51 |
<AlertDialogContent>
|
52 |
<AlertDialogHeader>
|
53 |
-
<AlertDialogTitle>
|
54 |
<AlertDialogDescription>
|
55 |
-
|
56 |
</AlertDialogDescription>
|
57 |
</AlertDialogHeader>
|
58 |
<div className="flex flex-col gap-4">
|
@@ -61,13 +63,13 @@ const ApiKeyAlert = ({ open: opened, onOpenChange: setOpened }: ApiKeyAlertProps
|
|
61 |
type="password"
|
62 |
value={tempApiKey}
|
63 |
onChange={handleTempApiKeyChange}
|
64 |
-
placeholder=
|
65 |
className="max-h-full w-full min-w-0"
|
66 |
autoComplete="off"
|
67 |
/>
|
68 |
|
69 |
<Button onClick={setApiKey} variant="outline" size="sm">
|
70 |
-
|
71 |
</Button>
|
72 |
</form>
|
73 |
{message && (
|
|
|
1 |
import { useState, useCallback, useEffect } from 'react'
|
2 |
+
import { useTranslation } from 'react-i18next'
|
3 |
import {
|
4 |
AlertDialog,
|
5 |
AlertDialogContent,
|
|
|
19 |
}
|
20 |
|
21 |
const ApiKeyAlert = ({ open: opened, onOpenChange: setOpened }: ApiKeyAlertProps) => {
|
22 |
+
const { t } = useTranslation()
|
23 |
const apiKey = useSettingsStore.use.apiKey()
|
24 |
const [tempApiKey, setTempApiKey] = useState<string>('')
|
25 |
const message = useBackendState.use.message()
|
|
|
52 |
<AlertDialog open={opened} onOpenChange={setOpened}>
|
53 |
<AlertDialogContent>
|
54 |
<AlertDialogHeader>
|
55 |
+
<AlertDialogTitle>{t('apiKeyAlert.title')}</AlertDialogTitle>
|
56 |
<AlertDialogDescription>
|
57 |
+
{t('apiKeyAlert.description')}
|
58 |
</AlertDialogDescription>
|
59 |
</AlertDialogHeader>
|
60 |
<div className="flex flex-col gap-4">
|
|
|
63 |
type="password"
|
64 |
value={tempApiKey}
|
65 |
onChange={handleTempApiKeyChange}
|
66 |
+
placeholder={t('apiKeyAlert.placeholder')}
|
67 |
className="max-h-full w-full min-w-0"
|
68 |
autoComplete="off"
|
69 |
/>
|
70 |
|
71 |
<Button onClick={setApiKey} variant="outline" size="sm">
|
72 |
+
{t('apiKeyAlert.save')}
|
73 |
</Button>
|
74 |
</form>
|
75 |
{message && (
|
lightrag_webui/src/locales/ar.json
CHANGED
@@ -259,5 +259,11 @@
|
|
259 |
},
|
260 |
"apiSite": {
|
261 |
"loading": "جارٍ تحميل وثائق واجهة برمجة التطبيقات..."
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
}
|
|
|
259 |
},
|
260 |
"apiSite": {
|
261 |
"loading": "جارٍ تحميل وثائق واجهة برمجة التطبيقات..."
|
262 |
+
},
|
263 |
+
"apiKeyAlert": {
|
264 |
+
"title": "مفتاح واجهة برمجة التطبيقات مطلوب",
|
265 |
+
"description": "الرجاء إدخال مفتاح واجهة برمجة التطبيقات للوصول إلى الخدمة",
|
266 |
+
"placeholder": "أدخل مفتاح واجهة برمجة التطبيقات",
|
267 |
+
"save": "حفظ"
|
268 |
}
|
269 |
}
|
lightrag_webui/src/locales/en.json
CHANGED
@@ -274,5 +274,11 @@
|
|
274 |
},
|
275 |
"apiSite": {
|
276 |
"loading": "Loading API Documentation..."
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
}
|
278 |
}
|
|
|
274 |
},
|
275 |
"apiSite": {
|
276 |
"loading": "Loading API Documentation..."
|
277 |
+
},
|
278 |
+
"apiKeyAlert": {
|
279 |
+
"title": "API Key is required",
|
280 |
+
"description": "Please enter your API key to access the service",
|
281 |
+
"placeholder": "Enter your API key",
|
282 |
+
"save": "Save"
|
283 |
}
|
284 |
}
|
lightrag_webui/src/locales/fr.json
CHANGED
@@ -259,5 +259,11 @@
|
|
259 |
},
|
260 |
"apiSite": {
|
261 |
"loading": "Chargement de la documentation de l'API..."
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
}
|
|
|
259 |
},
|
260 |
"apiSite": {
|
261 |
"loading": "Chargement de la documentation de l'API..."
|
262 |
+
},
|
263 |
+
"apiKeyAlert": {
|
264 |
+
"title": "Clé API requise",
|
265 |
+
"description": "Veuillez entrer votre clé API pour accéder au service",
|
266 |
+
"placeholder": "Entrez votre clé API",
|
267 |
+
"save": "Sauvegarder"
|
268 |
}
|
269 |
}
|
lightrag_webui/src/locales/zh.json
CHANGED
@@ -259,5 +259,11 @@
|
|
259 |
},
|
260 |
"apiSite": {
|
261 |
"loading": "正在加载 API 文档..."
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
}
|
|
|
259 |
},
|
260 |
"apiSite": {
|
261 |
"loading": "正在加载 API 文档..."
|
262 |
+
},
|
263 |
+
"apiKeyAlert": {
|
264 |
+
"title": "需要 API Key",
|
265 |
+
"description": "请输入您的 API Key 以访问服务",
|
266 |
+
"placeholder": "请输入 API Key",
|
267 |
+
"save": "保存"
|
268 |
}
|
269 |
}
|