diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index cd6d4397..a58327e5 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -1,28 +1,15 @@ import DocsGPT3 from './assets/cute_docsgpt3.svg'; -const demos: { header: string; query: string }[] = [ - { - header: 'Learn about DocsGPT', - query: 'What is DocsGPT?', - }, - { - header: 'Summarise documentation', - query: 'Summarise current context', - }, - { - header: 'Write Code', - query: 'Write code for api request to /api/answer', - }, - { - header: 'Learning Assistance', - query: 'Write potential questions for context', - }, -]; - +import { useTranslation } from 'react-i18next'; export default function Hero({ handleQuestion, }: { handleQuestion: (question: string) => void; }) { + const { t } = useTranslation(); + const demos = t('demo', { returnObjects: true }) as Array<{ + header: string; + query: string; + }>; return (
- New Chat + {t('newChat')}
Chats
+{t('chats')}
Source Docs
+{t('sourceDocs')}
- Settings + {t('settings.label')}
About
+{t('about')}
- DocsGPT uses GenAI, please review critial information using sources. + {t('tagline')}
diff --git a/frontend/src/locale/en.json b/frontend/src/locale/en.json index 22a51a2c..6d4fe8e2 100644 --- a/frontend/src/locale/en.json +++ b/frontend/src/locale/en.json @@ -1,39 +1,99 @@ { "language": "English", - "chat":"Chat", - "newChat":"New Chat", - "myPlan":"My Plan", - "about":"About", - "inputPlaceholder":"Type your message here...", - "tagline":"DocsGPT uses GenAI, please review critial information using sources.", - "sourceDocs":"Source Docs", - "settings":{ - "label":"Settings", - "general":{ - "label":"General", - "selectTheme":"Select Theme", - "light":"Light", - "dark":"Dark", - "selectLanguage":"Select Language", - "chunks":"Chunks processed per query", - "prompt":"Active Prompt", - "deleteAllLabel":"Delete all Conversation", - "deleteAllBtn":"Delete all", - "addNew":"Add New" + "chat": "Chat", + "newChat": "New Chat", + "myPlan": "My Plan", + "about": "About", + "inputPlaceholder": "Type your message here...", + "tagline": "DocsGPT uses GenAI, please review critial information using sources.", + "sourceDocs": "Source Docs", + "none":"None", + "demo":[ + { + "header": "Learn about DocsGPT", + "query": "What is DocsGPT?" }, - "documents":{ - "label":"Documents", - "name":"Document Name", - "date":"Vector Date", - "type":"Type", - "tokenUsage":"Token Usage" + { + "header": "Summarise documentation", + "query": "Summarise current context" }, - "apiKeys":{ - "label":"API Keys", + { + "header": "Write Code", + "query": "Write code for api request to /api/answer" + }, + { + "header": "Learning Assistance", + "query": "Write potential questions for context" + } + ], + "settings": { + "label": "Settings", + "general": { + "label": "General", + "selectTheme": "Select Theme", + "light": "Light", + "dark": "Dark", + "selectLanguage": "Select Language", + "chunks": "Chunks processed per query", + "prompt": "Active Prompt", + "deleteAllLabel": "Delete all Conversation", + "deleteAllBtn": "Delete all", + "addNew": "Add New" + }, + "documents": { + "label": "Documents", + "name": "Document Name", + "date": "Vector Date", + "type": "Type", + "tokenUsage": "Token Usage" + }, + "apiKeys": { + "label": "API Keys", + "name": "Name", + "key": "API Key", + "sourceDoc": "Source Document", + "createNew": "Create New" + } + }, + "modals":{ + "uploadDoc":{ + "label":"Upload New Documentation", + "file":"From File", + "remote":"Remote", "name":"Name", - "key":"API Key", - "sourceDoc":"Source Document", - "createNew":"Create New" + "choose":"Choose Files", + "info":"Please upload .pdf, .txt, .rst, .docx, .md, .zip limited to 25mb", + "uploadedFiles":"Uploaded Files", + "cancel":"Cancel", + "train":"Train", + "link":"Link", + "urlLink":"URL Link", + "reddit":{ + "id":"Client ID", + "secret":"Client Secret", + "agent":"User agent", + "searchQueries":"Search queries", + "numberOfPosts":"Number of posts" + } + }, + "createAPIKey":{ + "label":"Create New API Key", + "apiKeyName":"API Key Name", + "chunks":"Chunks processed per query", + "prompt":"Select active prompt", + "sourceDoc":"Source document", + "create":"Create" + }, + "saveKey":{ + "note":"Please save your Key", + "disclaimer":"This is the only time your key will be shown.", + "copy":"Copy", + "copied":"Copied", + "confirm":"I saved the Key" + }, + "deleteConv":{ + "confirm":"Are you sure you want to delete all the conversations?", + "delete":"Delete" } } } diff --git a/frontend/src/locale/es.json b/frontend/src/locale/es.json index 3d03bc39..f643b1d7 100644 --- a/frontend/src/locale/es.json +++ b/frontend/src/locale/es.json @@ -7,13 +7,32 @@ "inputPlaceholder": "Escribe tu mensaje aquí...", "tagline": "DocsGPT utiliza GenAI, por favor revisa información crítica utilizando fuentes.", "sourceDocs": "Documentos Fuente", + "none": "Nada", + "demo": [ + { + "header": "Aprende sobre DocsGPT", + "query": "¿Qué es DocsGPT?" + }, + { + "header": "Resumir documentación", + "query": "Resumir contexto actual" + }, + { + "header": "Escribir Código", + "query": "Escribir código para solicitud de API a /api/answer" + }, + { + "header": "Asistencia de Aprendizaje", + "query": "Escribe posibles preguntas para el contexto" + } + ], "settings": { "label": "Configuración", "general": { - "label":"General", + "label": "General", "selectTheme": "Seleccionar Tema", - "light":"de luz", - "dark":"oscura", + "light": "de luz", + "dark": "oscura", "selectLanguage": "Seleccionar Idioma", "chunks": "Trozos procesados por consulta", "prompt": "Prompt Activo", @@ -22,18 +41,55 @@ "addNew": "Agregar Nuevo" }, "documents": { - "label":"Documentos", + "label": "Documentos", "name": "Nombre del Documento", "date": "Fecha Vector", "type": "Tipo", "tokenUsage": "Uso de Tokens" }, "apiKeys": { - "label":"Claves API", + "label": "Claves API", "name": "Nombre", "key": "Clave de API", "sourceDoc": "Documento Fuente", "createNew": "Crear Nuevo" } + }, + "modals": { + "uploadDoc": { + "label": "Subir Nueva Documentación", + "file": "Desde Archivo", + "remote": "Remota", + "name": "Nombre", + "choose": "Seleccionar Archivos", + "info": "Por favor, suba archivos .pdf, .txt, .rst, .docx, .md, .zip limitados a 25 MB", + "uploadedFiles": "Archivos Subidos", + "cancel": "Cancelar", + "train": "Entrenar", + "link": "Enlace", + "urlLink": "Enlace URL", + "reddit": { + "id": "ID de Cliente", + "secret": "Secreto de Cliente", + "agent": "Agente de Usuario", + "searchQueries": "Consultas de Búsqueda", + "numberOfPosts": "Número de publicaciones" + } + }, + "createAPIKey": { + "label": "Crear Nueva Clave de API", + "apiKeyName": "Nombre de la Clave de API", + "chunks": "Fragmentos procesados por consulta", + "prompt": "Seleccione el prompt activo", + "sourceDoc": "Documento Fuente", + "create": "Crear" + }, + "saveKey": { + "note": "Por favor, guarde su Clave", + "disclaimer": "Esta es la única vez que se mostrará su clave.", + "copy": "Copiar", + "copied": "Copiado", + "confirm": "He guardado la Clave" + } } } diff --git a/frontend/src/modals/DeleteConvModal.tsx b/frontend/src/modals/DeleteConvModal.tsx index 4371fc14..c2fc5e38 100644 --- a/frontend/src/modals/DeleteConvModal.tsx +++ b/frontend/src/modals/DeleteConvModal.tsx @@ -3,7 +3,7 @@ import { useDispatch } from 'react-redux'; import { ActiveState } from '../models/misc'; import { useMediaQuery, useOutsideAlerter } from '../hooks'; import ConfirmationModal from './ConfirmationModal'; - +import { useTranslation } from 'react-i18next'; import { Action } from '@reduxjs/toolkit'; export default function DeleteConvModal({ @@ -18,7 +18,7 @@ export default function DeleteConvModal({ const modalRef = React.useRef(null); const dispatch = useDispatch(); const { isMobile } = useMediaQuery(); - + const { t } = useTranslation(); useOutsideAlerter( modalRef, () => { @@ -40,10 +40,10 @@ export default function DeleteConvModal({ return (- Chunks processed per query + {t('modals.createAPIKey.chunks')}
- Upload New Documentation + {t('modals.uploadDoc.label')}
- Please upload .pdf, .txt, .rst, .docx, .md, .zip limited to 25mb + {t('modals.uploadDoc.info')}
- Uploaded Files + {t('modals.uploadDoc.uploadedFiles')}
{files.map((file) => (@@ -294,7 +295,9 @@ export default function Upload({
))} {files.length === 0 && ( -None
++ {t('none')} +
)}