Skip to content
Open
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
38 changes: 38 additions & 0 deletions LOCALIZATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Localization & Translation Strategy

This document outlines the formal plan for handling localization and translation within the Plexus project. The goal is to ensure a consistent, high-quality, multi-language user experience.

## Core Principles

1. **English as Source of Truth**: The English message file (`dashboard/messages/en.json`) is the canonical source for all text in the application. All new text and changes must start here.
2. **Automated Translation**: To ensure efficiency, translations for other languages will be automatically generated from the English source file.
3. **Brand Consistency**: A "Brand Glossary" is maintained to govern the translation of specific terms, ensuring that brand names, trademarks, and key concepts are handled consistently across all languages.

## Current Implementation

- **Technology**: The dashboard utilizes the [`next-intl`](https://next-intl.dev/) library, integrated with the Next.js App Router.
- **Message Files**: Translation messages are stored as JSON files in the `dashboard/messages/` directory.
- **Routing**: Internationalized routing is handled via a `[locale]` dynamic segment in the `dashboard/app/` directory.

## Translation Status

- **English (`en`)**: Complete. This is the source of truth.
- **Spanish (`es`)**: Draft translations exist in `dashboard/messages/es.json`. These were generated before the formal glossary was established and have **not been proofread**. They should not be considered final and are subject to change based on the rules defined in this document.

## Translation Workflow

1. **Adding New Text**: All new user-facing text must be added as a key-value pair to `dashboard/messages/en.json`.
2. **Automatic Generation**: The localization pipeline will automatically detect changes in `en.json` and generate corresponding draft translations for all other supported languages.
3. **Applying Glossary Rules**: The pipeline will consult the Brand Glossary to apply specific rules, such as preventing the translation of certain words or enforcing specific translations.
4. **Proofreading**: Generated translations must be proofread by a native speaker before they are considered ready for production.

## Brand Glossary

This glossary defines how specific terms should be handled by the translation process.

| Term | Language | Instruction | Translation | Notes |
| :------ | :------- | :------------------ | :---------- | :--------------------------------------------------------------------------------------------------------------------- |
| `Plexus` | `All` | Do not translate | `Plexus` | This is a brand name. |
| `item` | `es` | Force translation | `ítem` | The Spanish word "ítem" is preferred for consistency, as advised by our Spanish language consultants. The accent is important. |

</rewritten_file>
8 changes: 8 additions & 0 deletions dashboard/app/[locale]/datasets/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use client";

import { redirect } from 'next/navigation'

export default function Datasets() {
// Redirect to the lab version
redirect('/lab/datasets')
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,188 @@
'use client';

import { useTranslationContext } from '@/app/contexts/TranslationContext'

export default function CliPage() {
const { locale } = useTranslationContext();

if (locale === 'es') {
return (
<div className="max-w-4xl mx-auto py-8 px-6">
<style jsx>{`
.code-container {
position: relative;
overflow-x: auto;
white-space: pre;
-webkit-overflow-scrolling: touch;
}

.code-container::after {
content: '';
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 16px;
background: linear-gradient(to right, transparent, var(--background-muted));
opacity: 0;
transition: opacity 0.2s;
pointer-events: none;
}

.code-container:hover::after {
opacity: 1;
}
`}</style>

<h1 className="text-4xl font-bold mb-4">
Herramienta CLI <code className="text-[36px]">plexus</code>
</h1>
<p className="text-lg text-muted-foreground mb-8">
Domina la interfaz de línea de comandos para gestionar tu implementación de Plexus.
</p>

<div className="space-y-8">
<section>
<h2 className="text-2xl font-semibold mb-4">Resumen</h2>
<p className="text-muted-foreground mb-4">
La herramienta CLI de Plexus proporciona una poderosa interfaz de línea de comandos para gestionar tu implementación de Plexus,
con enfoque en evaluar y monitorear el rendimiento de cuadros de puntuación.
</p>
</section>

<section>
<h2 className="text-2xl font-semibold mb-4">Instalación</h2>
<p className="text-muted-foreground mb-4">
Instala la herramienta CLI de Plexus usando pip:
</p>
<pre className="bg-muted rounded-lg mb-4">
<div className="code-container p-4">
<code>pip install plexus-cli</code>
</div>
</pre>
</section>

<section>
<h2 className="text-2xl font-semibold mb-4">Sistema de Identificadores Flexible</h2>
<p className="text-muted-foreground mb-4">
La CLI de Plexus usa un sistema de identificadores flexible que te permite referenciar recursos usando diferentes tipos de identificadores. Esto hace que los comandos sean más intuitivos y reduce la necesidad de buscar IDs específicos.
</p>

<div className="space-y-4">
<div>
<h3 className="text-xl font-medium mb-2">Identificadores de Cuadros de Puntuación</h3>
<p className="text-muted-foreground mb-4">
Al usar el parámetro <code>--scorecard</code>, puedes proporcionar cualquiera de los siguientes:
</p>
<ul className="list-disc pl-6 space-y-2 text-muted-foreground">
<li><strong>ID de DynamoDB</strong>: El identificador único de la base de datos (ej., <code>e51cd5ec-1940-4d8e-abcc-faa851390112</code>)</li>
<li><strong>Nombre</strong>: El nombre legible para humanos (ej., <code>"Aseguramiento de Calidad"</code>)</li>
<li><strong>Clave</strong>: La clave amigable para URLs (ej., <code>aseguramiento-calidad</code>)</li>
<li><strong>ID Externo</strong>: Tu identificador externo personalizado (ej., <code>qa-2023</code>)</li>
</ul>
</div>

<div>
<h3 className="text-xl font-medium mb-2">Identificadores de Puntuaciones</h3>
<p className="text-muted-foreground mb-4">
Similar a los cuadros de puntuación, las puntuaciones pueden referenciarse usando varios identificadores:
</p>

<ul className="list-disc pl-6 space-y-2 text-muted-foreground mb-6">
<li><strong>ID de DynamoDB</strong>: El UUID único asignado a la puntuación</li>
<li><strong>Nombre</strong>: El nombre legible para humanos de la puntuación</li>
<li><strong>Clave</strong>: La clave amigable para máquinas de la puntuación</li>
<li><strong>ID Externo</strong>: Un identificador externo opcional para la puntuación</li>
</ul>
</div>

<div>
<h3 className="text-xl font-medium mb-2">Identificadores de Cuenta</h3>
<p className="text-muted-foreground mb-4">
Al usar el parámetro <code>--account</code>, puedes proporcionar cualquiera de los siguientes:
</p>
<ul className="list-disc pl-6 space-y-2 text-muted-foreground">
<li><strong>ID de DynamoDB</strong>: El identificador único de la base de datos</li>
<li><strong>Nombre</strong>: El nombre legible para humanos</li>
<li><strong>Clave</strong>: La clave amigable para URLs</li>
</ul>
</div>
</div>
</section>

<section>
<h2 className="text-2xl font-semibold mb-4">Comandos Comunes de Cuadros de Puntuación</h2>
<p className="text-muted-foreground mb-4">
Aquí tienes algunos comandos comunes para gestionar cuadros de puntuación:
</p>

<pre className="bg-muted rounded-lg mb-4">
<div className="code-container p-4">
<code>{`# Listar todos los cuadros de puntuación
plexus scorecards list

# Obtener información detallada sobre un cuadro específico
plexus scorecards info --scorecard ejemplo1

# Listar todas las puntuaciones en un cuadro
plexus scores list --scorecard ejemplo1

# Extraer configuración del cuadro a YAML
plexus scorecards pull --scorecard ejemplo1 --output ./mis-cuadros

# Subir configuración del cuadro desde YAML
plexus scorecards push --scorecard ejemplo1 --file ./mi-cuadro.yaml --note "Configuración actualizada"

# Eliminar un cuadro
plexus scorecards delete --scorecard ejemplo1`}</code>
</div>
</pre>
</section>

<section>
<h2 className="text-2xl font-semibold mb-4">Ejecutar Evaluaciones</h2>
<p className="text-muted-foreground mb-4">
La forma principal de evaluar el rendimiento de tu cuadro es usando el comando <code>evaluate accuracy</code>:
</p>

<pre className="bg-muted rounded-lg mb-4">
<div className="code-container p-4">
<code>{`plexus \\
evaluate \\
accuracy \\
--scorecard "Leads Entrantes" \\
--number-of-samples 100 \\
--visualize`}</code>
</div>
</pre>

<div className="pl-4 space-y-2 text-muted-foreground mb-6">
<p><code>--scorecard</code>: Cuadro a evaluar (acepta ID, nombre, clave o ID externo)</p>
<p><code>--number-of-samples</code>: Número de muestras a evaluar (recomendado: 100+)</p>
<p><code>--visualize</code>: Generar visualizaciones de los resultados</p>
</div>

<p className="text-muted-foreground mb-4">
Este comando evaluará tu cuadro contra muestras etiquetadas y proporcionará métricas detalladas de precisión,
incluyendo precisión, recuperación y matrices de confusión cuando la visualización esté habilitada.
</p>
</section>

<section>
<h2 className="text-2xl font-semibold mb-4">Recursos Adicionales</h2>
<p className="text-muted-foreground">
Para información más detallada sobre características específicas:
</p>
<ul className="list-disc pl-6 space-y-2 text-muted-foreground mt-4">
<li>Visita nuestra <a href="/documentation/basics/evaluations" className="text-primary hover:underline">Guía de Evaluaciones</a></li>
<li>Consulta la ayuda integrada con <code>plexus --help</code></li>
<li>Obtén ayuda específica de comandos con <code>plexus evaluate accuracy --help</code></li>
</ul>
</section>
</div>
</div>
);
}
return (
<div className="max-w-4xl mx-auto py-8 px-6">
<style jsx>{`
Expand Down
Loading
Loading