Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync locales #1591

Merged
merged 8 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions frontend/src/components/DocumentPagination.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import SingleArrowLeft from '../assets/single-left-arrow.svg';
import SingleArrowRight from '../assets/single-right-arrow.svg';
import DoubleArrowLeft from '../assets/double-arrow-left.svg';
Expand All @@ -19,6 +20,7 @@ const Pagination: React.FC<PaginationProps> = ({
onPageChange,
onRowsPerPageChange,
}) => {
const { t } = useTranslation();
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
const rowsPerPageOptions = [5, 10, 20, 50];

Expand Down Expand Up @@ -53,7 +55,9 @@ const Pagination: React.FC<PaginationProps> = ({
<div className="flex items-center text-xs justify-end gap-4 mt-2 p-2 border-gray-200">
{/* Rows per page dropdown */}
<div className="flex items-center gap-2 relative">
<span className="text-gray-900 dark:text-gray-50">Rows per page:</span>
<span className="text-gray-900 dark:text-gray-50">
{t('pagination.rowsPerPage')}:
</span>
<div className="relative">
<button
onClick={toggleDropdown}
Expand Down Expand Up @@ -87,7 +91,7 @@ const Pagination: React.FC<PaginationProps> = ({

{/* Pagination controls */}
<div className="text-gray-900 dark:text-gray-50">
Page {currentPage} of {totalPages}
{t('pagination.pageOf', { currentPage, totalPages })}
</div>
<div className="flex items-center gap-2 text-gray-900 dark:text-gray-50">
<button
Expand All @@ -97,7 +101,7 @@ const Pagination: React.FC<PaginationProps> = ({
>
<img
src={DoubleArrowLeft}
alt="First page"
alt={t('pagination.firstPage')}
className="dark:invert dark:sepia dark:brightness-200"
/>
</button>
Expand All @@ -108,7 +112,7 @@ const Pagination: React.FC<PaginationProps> = ({
>
<img
src={SingleArrowLeft}
alt="Previous page"
alt={t('pagination.previousPage')}
className="dark:invert dark:sepia dark:brightness-200"
/>
</button>
Expand All @@ -119,7 +123,7 @@ const Pagination: React.FC<PaginationProps> = ({
>
<img
src={SingleArrowRight}
alt="Next page"
alt={t('pagination.nextPage')}
className="dark:invert dark:sepia dark:brightness-200"
/>
</button>
Expand All @@ -130,7 +134,7 @@ const Pagination: React.FC<PaginationProps> = ({
>
<img
src={DoubleArrowRight}
alt="Last page"
alt={t('pagination.lastPage')}
className="dark:invert dark:sepia dark:brightness-200"
/>
</button>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/conversation/ConversationBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ const ConversationBubble = forwardRef<
className="rounded-full bg-[#CDB5FF] hover:bg-[#E1D3FF] py-[10px] px-[15px] text-purple-30 max-w-full whitespace-pre-wrap leading-none"
onClick={() => handleEditClick()}
>
Update
{t('conversation.edit.update')}
</button>
<button
className="py-[10px] px-[15px] no-underline hover:underline text-purple-30 max-w-full whitespace-pre-wrap leading-normal"
onClick={() => setIsEditClicked(false)}
>
Cancel
{t('conversation.edit.cancel')}
</button>
</div>
</div>
Expand Down
71 changes: 60 additions & 11 deletions frontend/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"noData": "No existing Documents",
"searchPlaceholder": "Search...",
"addNew": "Add New",
"addNewTitle": "Add New Document",
"preLoaded": "Pre-loaded",
"private": "Private",
"sync": "Sync",
Expand All @@ -82,24 +81,40 @@
"noData": "No existing Chatbots"
},
"analytics": {
"label": "Analytics"
"label": "Analytics",
"filterByChatbot": "Filter by chatbot",
"selectChatbot": "Select chatbot",
"filterOptions": {
"hour": "Hour",
"last24Hours": "24 Hours",
"last7Days": "7 Days",
"last15Days": "15 Days",
"last30Days": "30 Days"
},
"messages": "Messages",
"tokenUsage": "Token Usage",
"feedback": "Feedback",
"filterPlaceholder": "Filter",
"none": "None",
"positiveFeedback": "Positive Feedback",
"negativeFeedback": "Negative Feedback"
},
"logs": {
"label": "Logs",
"filterByChatbot": "Filter by chatbot",
"selectChatbot": "Select chatbot",
"none": "None",
"selectChatbotPlaceholder": "Select chatbot",
"apiGeneratedConversations": "API generated / chatbot conversations"
"tableHeader": "API generated / chatbot conversations"
},
"tools": {
"label": "Tools",
"searchPlaceholder": "Search tools...",
"addTool": "Add Tool",
"noToolsFound": "No tools found",
"selectToolSetup": "Select a tool to set up",
"settingsIconAlt": "Settings icon",
"configureToolAria": "Configure {toolName}",
"toggleToolAria": "Toggle {toolName}",
"selectToolSetup": "Select a tool to set up"
"toggleToolAria": "Toggle {toolName}"
}
},
"modals": {
Expand All @@ -125,11 +140,19 @@
"secret": "Client Secret",
"agent": "User agent",
"searchQueries": "Search queries",
"numberOfPosts": "Number of posts"
"numberOfPosts": "Number of posts",
"addQuery": "Add Query"
},
"drag": {
"title": "Upload a source file",
"description": "Drop your file here to add it as a source"
},
"progress": {
"upload": "Upload is in progress",
"training": "Training is in progress",
"completed": "Training completed",
"wait": "This may take several minutes",
"tokenLimit": "Over the token limit, please consider uploading smaller document"
}
},
"createAPIKey": {
Expand All @@ -156,6 +179,24 @@
"note": "Source document, personal information and further conversation will remain private",
"create": "Create",
"option": "Allow users to prompt further"
},
"configTool": {
"title": "Tool Config",
"type": "Type",
"apiKeyLabel": "API Key / OAuth",
"apiKeyPlaceholder": "Enter API Key / OAuth",
"addButton": "Add Tool",
"closeButton": "Close"
},
"prompts": {
"addPrompt": "Add Prompt",
"addDescription": "Add your custom prompt and save it to DocsGPT",
"editPrompt": "Edit Prompt",
"editDescription": "Edit your custom prompt and save it to DocsGPT",
"promptName": "Prompt Name",
"promptText": "Prompt Text",
"save": "Save",
"nameExists": "Name already exists"
}
},
"sharedConv": {
Expand All @@ -169,20 +210,28 @@
"rename": "Rename",
"deleteWarning": "Are you sure you want to delete this conversation?"
},
"pagination": {
"rowsPerPage": "Rows per page",
"pageOf": "Page {{currentPage}} of {{totalPages}}",
"firstPage": "First page",
"previousPage": "Previous page",
"nextPage": "Next page",
"lastPage": "Last page"
},
"conversation": {
"copy": "Copy",
"copied": "Copied",
"speak": "Speak",
"answer": "Answer",
"send": "Send message",
"loading": "Loading response",
"edit": {
"update": "Update",
"cancel": "Cancel",
"placeholder": "Type the updated query..."
},
"sources": {
"title": "Sources",
"text": "Source Text",
"link": "Source Link",
"text": "Source text",
"link": "Source link",
"view_more": "{{count}} more sources"
},
"retry": "Retry"
Expand Down
95 changes: 77 additions & 18 deletions frontend/src/locale/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"noData": "No hay documentos existentes",
"searchPlaceholder": "Buscar...",
"addNew": "Agregar Nuevo",
"addNewTitle": "Agregar Nuevo Documento",
"preLoaded": "Precargado",
"private": "Privado",
"sync": "Sincronizar",
Expand All @@ -70,7 +69,8 @@
"daily": "Diario",
"weekly": "Semanal",
"monthly": "Mensual"
}
},
"actions": "Acciones"
},
"apiKeys": {
"label": "Chatbots",
Expand All @@ -81,17 +81,40 @@
"noData": "No hay chatbots existentes"
},
"analytics": {
"label": "Analítica"
"label": "Analítica",
"filterByChatbot": "Filtrar por chatbot",
"selectChatbot": "Seleccionar chatbot",
"filterOptions": {
"hour": "Hora",
"last24Hours": "24 Horas",
"last7Days": "7 Días",
"last15Days": "15 Días",
"last30Days": "30 Días"
},
"messages": "Mensajes",
"tokenUsage": "Uso de Tokens",
"feedback": "Retroalimentación",
"filterPlaceholder": "Filtrar",
"none": "Ninguno",
"positiveFeedback": "Retroalimentación Positiva",
"negativeFeedback": "Retroalimentación Negativa"
},
"logs": {
"label": "Registros",
"filterByChatbot": "Filtrar por chatbot",
"selectChatbot": "Seleccionar chatbot",
"none": "Ninguno",
"selectChatbotPlaceholder": "Seleccionar chatbot",
"apiGeneratedConversations": "Conversaciones generadas por API / chatbot"
"tableHeader": "Conversaciones generadas por API / chatbot"
},
"tools": {
"label": "Herramientas"
"label": "Herramientas",
"searchPlaceholder": "Buscar...",
"addTool": "Agregar Herramienta",
"noToolsFound": "No se encontraron herramientas",
"selectToolSetup": "Seleccione una herramienta para configurar",
"settingsIconAlt": "Icono de configuración",
"configureToolAria": "Configurar {toolName}",
"toggleToolAria": "Alternar {toolName}"
}
},
"modals": {
Expand All @@ -113,15 +136,23 @@
"urlLink": "Enlace URL",
"repoUrl": "URL del Repositorio",
"reddit": {
"id": "ID de Cliente",
"secret": "Secreto de Cliente",
"agent": "Agente de Usuario",
"searchQueries": "Consultas de Búsqueda",
"numberOfPosts": "Número de publicaciones"
"id": "ID del Cliente",
"secret": "Secreto del Cliente",
"agent": "Agente de usuario",
"searchQueries": "Consultas de búsqueda",
"numberOfPosts": "Número de publicaciones",
"addQuery": "Agregar Consulta"
},
"drag": {
"title": "Carga un archivo fuente",
"description": "Suelta tu archivo aquí para añadirlo como fuente"
"title": "Subir archivo fuente",
"description": "Arrastra tu archivo aquí para agregarlo como fuente"
},
"progress": {
"upload": "Subida en progreso",
"training": "Entrenamiento en progreso",
"completed": "Entrenamiento completado",
"wait": "Esto puede tardar varios minutos",
"tokenLimit": "Excede el límite de tokens, considere cargar un documento más pequeño"
}
},
"createAPIKey": {
Expand All @@ -148,6 +179,24 @@
"note": "El documento fuente, información personal y conversaciones posteriores permanecerán privadas",
"create": "Crear",
"option": "Permitir a los usuarios realizar más consultas"
},
"configTool": {
"title": "Configuración de la Herramienta",
"type": "Tipo",
"apiKeyLabel": "Clave API / OAuth",
"apiKeyPlaceholder": "Ingrese la Clave API / OAuth",
"addButton": "Agregar Herramienta",
"closeButton": "Cerrar"
},
"prompts": {
"addPrompt": "Agregar Prompt",
"addDescription": "Agrega tu prompt personalizado y guárdalo en DocsGPT",
"editPrompt": "Editar Prompt",
"editDescription": "Edita tu prompt personalizado y guárdalo en DocsGPT",
"promptName": "Nombre del Prompt",
"promptText": "Texto del Prompt",
"save": "Guardar",
"nameExists": "El nombre ya existe"
}
},
"sharedConv": {
Expand All @@ -159,21 +208,31 @@
"share": "Compartir",
"delete": "Eliminar",
"rename": "Renombrar",
"deleteWarning": "¿Estás seguro de que deseas eliminar esta conversación?"
"deleteWarning": "¿Está seguro de que desea eliminar esta conversación?"
},
"pagination": {
"rowsPerPage": "Filas por página",
"pageOf": "Página {{currentPage}} de {{totalPages}}",
"firstPage": "Primera página",
"previousPage": "Página anterior",
"nextPage": "Página siguiente",
"lastPage": "Última página"
},
"conversation": {
"copy": "Copiar",
"copied": "Copiado",
"speak": "Hablar",
"answer": "Respuesta",
"edit": {
"placeholder": "Escribe la consulta actualizada..."
"update": "Actualizar",
"cancel": "Cancelar",
"placeholder": "Ingrese la consulta actualizada..."
},
"sources": {
"title": "Fuentes",
"text": "Texto de la Fuente",
"link": "Enlace de la Fuente",
"view_more": "{{count}} más fuentes"
"text": "Texto fuente",
"link": "Enlace fuente",
"view_more": "Ver {{count}} más fuentes"
},
"retry": "Reintentar"
}
Expand Down
Loading
Loading