API de Python¶
La API pública estable de Python se exporta desde co_op_translator.api. La mayoría de las integraciones usan uno de estos flujos de trabajo:
| Escenario | Úsalo cuando | APIs principales |
|---|---|---|
| Translate individual files or documents | Your application reads source content, calls Co-op Translator for translation, and decides where to save the result. | translate_markdown_content, translate_notebook_content, translate_image_content, rewrite_markdown_paths, rewrite_notebook_paths |
| Prepare content for host-agent translation | Your MCP host or application model will translate chunks, while Co-op Translator handles chunking and reconstruction. | start_markdown_agent_translation, finish_markdown_agent_translation, start_notebook_agent_translation, finish_notebook_agent_translation |
| Translate an entire repository | You want the Python API to behave like the CLI and handle discovery, output paths, metadata, cleanup, and writes. | run_translation |
Most lower-level modules under core, config, review, and utils are implementation details used by these API entry points.
MCP clients use the same public API through the MCP Server. Use this page when calling Python directly, and the MCP guide when exposing Co-op Translator to an agent or editor. If you are deciding between CLI, Python API, and MCP, start with Choose Your Workflow.
Flujo inicial de la API¶
Start here if you are calling Co-op Translator from Python code:
- Configure an LLM provider as described in Configuration, unless you are only preparing Markdown or notebook chunks for host-agent translation.
- Decide whether your application owns file I/O.
- Use content APIs when your application reads and writes individual files.
- Use
run_translationwhen Co-op Translator should process a repository like the CLI. - Use
run_reviewafter translation if you need deterministic checks in automation.
| Objetivo | API para comenzar |
|---|---|
| Translate one Markdown string or file | translate_markdown_content |
| Translate one notebook payload | translate_notebook_content |
| Translate one image | translate_image_content |
| Let a host agent translate Markdown or notebook chunks | start_markdown_agent_translation or start_notebook_agent_translation |
| Rewrite translated links after choosing an output path | rewrite_markdown_paths or rewrite_notebook_paths |
| Translate a full repository | run_translation |
| Review translated output | run_review |
Escenario 1: Traducir archivos o documentos individuales¶
Use this workflow when you already have a file, editor buffer, notebook payload, MCP request, or custom pipeline input. Your code owns file I/O:
- Read the source content.
- Call a content translation API.
- Optionally call a path rewriting API if the translated content will be written into a project translation folder.
- Save or return the result from your application.
The content translation APIs do not run project discovery, do not write metadata, do not append disclaimers, and do not rewrite links automatically.
Archivo Markdown¶
import asyncio
from pathlib import Path
from co_op_translator.api import (
rewrite_markdown_paths,
translate_markdown_content,
)
async def main() -> None:
source_path = Path("docs/guide.md")
target_path = Path("translations/ko/docs/guide.md")
translated = await translate_markdown_content(
source_path.read_text(encoding="utf-8"),
"ko",
{"source_path": source_path},
)
rewritten = rewrite_markdown_paths(
translated,
source_path=source_path,
target_path=target_path,
policy={
"language_code": "ko",
"root_dir": ".",
"translations_dir": "translations",
"translated_images_dir": "translated_images",
"translation_types": ["markdown", "images"],
},
)
target_path.parent.mkdir(parents=True, exist_ok=True)
target_path.write_text(rewritten, encoding="utf-8")
asyncio.run(main())
Si el Markdown traducido no vivirá en un diseño de proyecto de Co-op Translator, omite rewrite_markdown_paths y guarda la cadena traducida directamente.
Archivo de Notebook¶
import asyncio
from pathlib import Path
from co_op_translator.api import (
rewrite_notebook_paths,
translate_notebook_content,
)
async def main() -> None:
source_path = Path("docs/tutorial.ipynb")
target_path = Path("translations/ja/docs/tutorial.ipynb")
translated_json = await translate_notebook_content(
source_path.read_text(encoding="utf-8"),
"ja",
{"source_path": source_path},
)
rewritten_json = rewrite_notebook_paths(
translated_json,
source_path=source_path,
target_path=target_path,
policy={
"language_code": "ja",
"root_dir": ".",
"translations_dir": "translations",
"translated_images_dir": "translated_images",
"translation_types": ["notebook", "images"],
},
)
target_path.parent.mkdir(parents=True, exist_ok=True)
target_path.write_text(rewritten_json, encoding="utf-8")
asyncio.run(main())
translate_notebook_content traduce las celdas Markdown y preserva las celdas no Markdown. La reescritura de rutas se aplica solo a las celdas Markdown.
Archivo de imagen¶
from pathlib import Path
from co_op_translator.api import translate_image_content
source_path = Path("docs/images/hero.png")
target_path = Path("translated_images/fr/hero.png")
translated_image = translate_image_content(
source_path,
"fr",
{
"root_dir": ".",
"fast_mode": False,
},
)
target_path.parent.mkdir(parents=True, exist_ok=True)
translated_image.save(target_path)
translate_image_content lee la imagen fuente y devuelve un PIL.Image.Image renderizado. No escribe metadatos de imagen traducida.
Escenario 2: Traducir un repositorio completo¶
Use this workflow when you want the Python API to behave like the translate CLI. run_translation discovers supported files, translates selected content types, rewrites paths, writes output files, updates metadata, and performs translation maintenance tasks such as cleanup.
run_translation is the preferred project orchestration entry point. translate_project is exported as a compatibility alias with the same behavior.
Translate Markdown files in the current repository into Korean and Japanese:
from co_op_translator.api import run_translation
run_translation(
language_codes="ko ja",
markdown=True,
)
Translate only notebooks from a specific project root:
from co_op_translator.api import run_translation
run_translation(
language_codes="fr",
root_dir="./my-course",
notebook=True,
)
Preview translation volume without writing files:
from co_op_translator.api import run_translation
run_translation(
language_codes="es de",
root_dir="./my-course",
markdown=True,
dry_run=True,
)
Translate multiple content roots in one call:
from co_op_translator.api import run_translation
run_translation(
language_codes="ko",
markdown=True,
root_dirs=["./docs", "./labs"],
)
Write translations into explicit output groups:
from co_op_translator.api import run_translation
run_translation(
language_codes="ja",
markdown=True,
groups=[
("./course-a", "./localized/course-a"),
("./course-b", "./localized/course-b"),
],
)
Use a per-language placeholder when each language should contain a nested subdirectory:
from co_op_translator.api import run_translation
run_translation(
language_codes="ko",
markdown=True,
groups=[
("./course", "./translations/<lang>/course"),
],
)
If none of markdown, notebook, or images are set, the API translates all supported types: Markdown, notebooks, and images.
Revisar la salida traducida¶
run_review runs deterministic translation checks without LLM or Vision credentials.
Beta
run_review is a beta deterministic review API. It does not call model providers or write files, but checks and issue schemas may evolve.
from co_op_translator.api import run_review
run_review(
language_codes="ko ja",
root_dir="./my-course",
markdown=True,
notebook=True,
)
Review only files changed against a base ref and print GitHub-flavored output:
from co_op_translator.api import run_review
run_review(
language_codes="ko",
root_dir="./my-course",
markdown=True,
notebook=True,
changed_from="origin/main",
output_format="github",
)
Ejemplos de API para copiar y pegar¶
Translate Markdown content without file writes:
import asyncio
from co_op_translator.api import translate_markdown_content
async def main() -> None:
translated = await translate_markdown_content(
"# Hello\n\nWelcome to the course.",
"ko",
)
print(translated)
asyncio.run(main())
Translate and rewrite Markdown links:
import asyncio
from co_op_translator.api import rewrite_markdown_paths, translate_markdown_content
async def main() -> None:
translated = await translate_markdown_content(
"[Setup](../setup.md)\n\n",
"ko",
{"source_path": "docs/guide.md"},
)
rewritten = rewrite_markdown_paths(
translated,
source_path="docs/guide.md",
target_path="translations/ko/docs/guide.md",
policy={
"language_code": "ko",
"root_dir": ".",
"translations_dir": "translations",
"translated_images_dir": "translated_images",
"translation_types": ["markdown", "images"],
},
)
print(rewritten)
asyncio.run(main())
Translate a repository from Python:
from co_op_translator.api import run_translation
run_translation(
language_codes="ko ja",
root_dir="./course",
markdown=True,
yes=True,
)
Translate multiple roots:
from co_op_translator.api import run_translation
run_translation(
language_codes="ko",
markdown=True,
root_dirs=[
"./docs",
"./labs",
],
)
Preserve glossary terms:
from co_op_translator.api import run_translation
run_translation(
language_codes="fr",
markdown=True,
glossaries=[
"Co-op Translator",
"Azure AI Foundry",
"GitHub Actions",
],
)
Puntos de entrada públicos¶
from co_op_translator.api import (
ImageTranslationOptions,
MarkdownTranslationOptions,
NotebookTranslationOptions,
finish_markdown_agent_translation,
finish_notebook_agent_translation,
run_review,
run_translation,
rewrite_markdown_paths,
rewrite_notebook_paths,
start_markdown_agent_translation,
start_notebook_agent_translation,
translate_image_content,
translate_markdown_content,
translate_notebook_content,
translate_project,
)
co_op_translator.api.translate_markdown_content
async
¶
translate_markdown_content(document: str, language_code: str, options: MarkdownTranslationOptions | Mapping[str, object] | None = None) -> str
Translate markdown content without project path rewriting or file I/O.
co_op_translator.api.translate_notebook_content
async
¶
translate_notebook_content(notebook: str | dict[str, object], language_code: str, options: NotebookTranslationOptions | Mapping[str, object] | None = None) -> str
Translate notebook markdown cells without project path rewriting or file I/O.
co_op_translator.api.translate_image_content ¶
translate_image_content(image_path: str | Path, language_code: str, options: ImageTranslationOptions | Mapping[str, object] | None = None) -> Image.Image
Translate image text and return a rendered image without saving metadata.
co_op_translator.api.start_markdown_agent_translation ¶
start_markdown_agent_translation(document: str, language_code: str, source_path: str | Path | None = None) -> dict[str, object]
Prepare provider-free Markdown chunks for host-agent translation.
co_op_translator.api.finish_markdown_agent_translation ¶
finish_markdown_agent_translation(job: Mapping[str, object], translated_chunks: Mapping[str, object] | list[Mapping[str, object]]) -> dict[str, object]
Reconstruct Markdown from chunks translated by a host agent.
co_op_translator.api.start_notebook_agent_translation ¶
start_notebook_agent_translation(notebook: str | Mapping[str, object], language_code: str, source_path: str | Path | None = None) -> dict[str, object]
Prepare provider-free notebook Markdown chunks for host-agent translation.
co_op_translator.api.finish_notebook_agent_translation ¶
finish_notebook_agent_translation(job: Mapping[str, object], translated_chunks: Mapping[str, object] | list[Mapping[str, object]]) -> dict[str, object]
Reconstruct a notebook from Markdown chunks translated by a host agent.
co_op_translator.api.rewrite_markdown_paths ¶
rewrite_markdown_paths(content: str, source_path: str | Path, target_path: str | Path, policy: MarkdownPathRewritePolicy | Mapping[str, object]) -> str
Rewrite markdown/frontmatter paths for a translated project target.
co_op_translator.api.rewrite_notebook_paths ¶
rewrite_notebook_paths(content: str, source_path: str | Path, target_path: str | Path, policy: MarkdownPathRewritePolicy | Mapping[str, object]) -> str
Rewrite markdown-cell paths for a translated project notebook target.
co_op_translator.api.MarkdownTranslationOptions
dataclass
¶
Options for content-only markdown translation.
co_op_translator.api.NotebookTranslationOptions
dataclass
¶
Options for content-only notebook translation.
co_op_translator.api.ImageTranslationOptions
dataclass
¶
Options for content-only image translation.
co_op_translator.api.run_translation ¶
run_translation(language_codes: str, root_dir: str = '.', update: bool = False, images: bool = False, markdown: bool = False, notebook: bool = False, debug: bool = False, save_logs: bool = False, yes: bool = True, add_disclaimer: bool = False, translations_dir: str | None = None, image_dir: str | None = None, root_dirs: Iterable[str] | None = None, groups: Iterable[tuple[str, str | None]] | None = None, repo_url: str | None = None, glossaries: Iterable[str] | None = None, readme_only: bool = False, dry_run: bool = False, progress_callback: TranslationEventCallback | None = None, json_events_path: str | Path | None = None) -> None
Programmatic translation entrypoint mirroring the translate CLI options.
progress_callback receives versioned TranslationEvent objects for
integration code. json_events_path writes the same events as NDJSON.
co_op_translator.api.translate_project ¶
Programmatic project translation entrypoint.
co_op_translator.api.run_review ¶
run_review(language_codes: str | Iterable[str] = 'all', root_dir: str = '.', update: bool = False, images: bool = False, markdown: bool = False, notebook: bool = False, debug: bool = False, save_logs: bool = False, yes: bool = True, add_disclaimer: bool = False, translations_dir: str | None = None, image_dir: str | None = None, root_dirs: Iterable[str] | None = None, groups: Iterable[tuple[str, str | None]] | None = None, repo_url: str | None = None, glossaries: Iterable[str] | None = None, dry_run: bool = False, changed_from: str | None = None, output_format: str = 'text', fail_on_warnings: bool = False) -> ReviewSummary
Programmatic deterministic review entrypoint.
The signature intentionally mirrors run_translation where possible so
automation can switch between translate and review workflows with minimal
branching. Review ignores mutating translation-only options such as
update, yes, add_disclaimer, repo_url, glossaries, and
dry_run.
APIs de traducción de contenido¶
Content translation APIs are intended for integrations that already have content in memory, such as an editor extension, MCP tool, notebook processor, or custom pipeline.
| Función | Entrada | Salida | I/O de archivos | Notas |
|---|---|---|---|---|
translate_markdown_content |
Markdown str |
Markdown str |
No | Async. Translates Markdown content only. It does not rewrite links, write metadata, or append disclaimers. |
translate_notebook_content |
Notebook JSON str or dict |
Notebook JSON str |
No | Async. Translates Markdown cells and preserves non-Markdown cells. It does not rewrite links, write metadata, or append disclaimers. |
translate_image_content |
Image path | PIL.Image.Image |
Reads source image only | Synchronous. Extracts and translates image text, then returns a rendered image. It does not save translated image metadata. |
translate_markdown_content and translate_notebook_content accept an optional source_path through their options. The path is passed as context to the translator; callers remain responsible for any project-specific path rewriting after translation.
from co_op_translator.api import MarkdownTranslationOptions, translate_markdown_content
translated = await translate_markdown_content(
document,
"ko",
MarkdownTranslationOptions(source_path="docs/guide.md"),
)
The same options can be passed as dictionaries:
APIs de traducción asistida por agentes¶
Agent-assisted APIs do not call Azure OpenAI or OpenAI from Co-op Translator. They prepare Markdown or notebook chunks for a host agent to translate, then reconstruct the final content from translated chunks.
| Function | Purpose |
|---|---|
start_markdown_agent_translation |
Return a self-contained Markdown job with chunks, prompts, and reconstruction state. |
finish_markdown_agent_translation |
Reconstruct Markdown from a job and host-agent translated chunks. |
start_notebook_agent_translation |
Return a notebook job with Markdown-cell chunks for host-agent translation. |
finish_notebook_agent_translation |
Reconstruct notebook JSON while preserving code cells, outputs, and metadata. |
This workflow is mainly intended for MCP hosts. If you need production repository translation with Co-op Translator managing provider calls, use translate_markdown_content, translate_notebook_content, or run_translation.
APIs de reescritura de rutas¶
Path rewriting APIs perform no translation. They update links and frontmatter paths after callers know the source path, translated target path, and project layout.
| Function | Scope | Notes |
|---|---|---|
rewrite_markdown_paths |
Markdown body and frontmatter | Rewrites Markdown links and supported frontmatter path fields for a translated target. |
rewrite_notebook_paths |
Markdown cells in notebook JSON | Applies Markdown path rewriting to each Markdown cell and leaves non-Markdown cells unchanged. |
The policy argument may be a dictionary with these fields:
| Field | Required | Purpose |
|---|---|---|
language_code |
Yes | Target language code, such as "ko" or "pt-BR". |
root_dir |
No | Source project root. Defaults to ".". |
translations_dir |
No | Text translation output directory. Defaults to translations under root_dir. |
translated_images_dir |
No | Translated image output directory. Defaults to translated_images under root_dir. |
translation_types |
No | Enabled translation types. Defaults to Markdown, notebooks, and images. |
lang_subdir |
No | Optional subdirectory under each language folder. |
Parámetros de traducción del proyecto¶
| Parámetro | Tipo | Predeterminado | Propósito |
|---|---|---|---|
language_codes |
str |
Required | Space-separated target language codes, such as "ko ja fr", or "all". Alias codes are normalized to canonical BCP 47 values. |
root_dir |
str |
"." |
Project root for a single translation target. Ignored when root_dirs or groups are supplied. |
update |
bool |
False |
Delete and recreate existing translations for the selected languages. |
images |
bool |
False |
Include image translation. Requires Azure AI Vision configuration. |
markdown |
bool |
False |
Include Markdown translation. |
notebook |
bool |
False |
Include Jupyter notebook translation. |
debug |
bool |
False |
Enable debug logging. |
save_logs |
bool |
False |
Save DEBUG-level log files under the root logs/ directory. |
yes |
bool |
True |
Auto-confirm prompts for programmatic and CI usage. |
add_disclaimer |
bool |
False |
Add machine translation disclaimers to translated Markdown and notebooks. |
translations_dir |
str \| None |
None |
Custom text translation output directory. Relative paths resolve against each root. |
image_dir |
str \| None |
None |
Custom translated image output directory. Relative paths resolve against each root. |
root_dirs |
Iterable[str] \| None |
None |
Multiple roots that share the same output settings. |
groups |
Iterable[tuple[str, str \| None]] \| None |
None |
Explicit (root_dir, translations_dir) pairs. Takes precedence over root_dirs. |
repo_url |
str \| None |
None |
Repository URL used when rendering README language table guidance. |
glossaries |
Iterable[str] \| None |
None |
Glossary terms to preserve during translation. Duplicates and blank terms are normalized. |
dry_run |
bool |
False |
Estimate translation volume and preview migration behavior without writing files. |
Parámetros de revisión¶
run_review intentionally mirrors the run_translation signature where possible so automation can switch between translation and review workflows with minimal branching.
| Parameter | Type | Default | Purpose |
|---|---|---|---|
language_codes |
str \| Iterable[str] |
"all" |
Target language folders to review. Space-separated strings and iterables are accepted. "all" reviews every discovered translation language. |
root_dir |
str |
"." |
Project root for a single review target. Ignored when root_dirs or groups are supplied. |
markdown |
bool |
False |
Include Markdown and MDX source files. |
notebook |
bool |
False |
Include Jupyter notebook source files. |
images |
bool |
False |
Reserved for parity with translation options. Link references to images are checked from Markdown. |
translations_dir |
str \| None |
None |
Directorio de salida personalizado para las traducciones de texto. Las rutas relativas se resuelven respecto a cada raíz. |
root_dirs |
Iterable[str] \| None |
None |
Múltiples raíces que comparten la misma configuración de salida. |
groups |
Iterable[tuple[str, str \| None]] \| None |
None |
Pares explícitos (root_dir, translations_dir). Tiene prioridad sobre root_dirs. |
changed_from |
str \| None |
None |
Referencia Git utilizada para limitar la revisión a archivos fuente modificados. |
output_format |
str |
"text" |
Formato de salida de la revisión. Los valores compatibles son "text" y "github". |
fail_on_warnings |
bool |
False |
Tratar las advertencias como fallos además de errores. |
debug |
bool |
False |
Habilitar el registro de depuración. |
save_logs |
bool |
False |
Guardar archivos de registro de nivel DEBUG en el directorio raíz logs/. |
If none of markdown, notebook, or images are set, the API reviews Markdown, notebooks, and image link references where applicable. Review does not call an LLM provider and does not require API keys.
Requisitos de configuración¶
Provider-backed translation APIs require provider configuration before translating:
- La traducción de Markdown y notebooks requiere un proveedor LLM. Configure either Azure OpenAI or OpenAI.
- La traducción de imágenes requiere Azure AI Vision además del proveedor LLM.
run_translationejecuta comprobaciones de conectividad ligeras antes de que comience la traducción del proyecto.- Las API asistidas por agentes
start_*_agent_translationyfinish_*_agent_translationno llaman a los proveedores LLM de Co-op Translator. La aplicación anfitriona o el agente MCP traduce los fragmentos preparados. rewrite_markdown_paths,rewrite_notebook_pathsyrun_reviewson deterministas y no requieren credenciales del proveedor.
Required Azure OpenAI variables:
AZURE_OPENAI_API_KEY="..."
AZURE_OPENAI_ENDPOINT="https://<resource>.openai.azure.com/"
AZURE_OPENAI_MODEL_NAME="gpt-4o"
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME="<deployment>"
AZURE_OPENAI_API_VERSION="2024-12-01-preview"
Required OpenAI variables:
Required Azure AI Vision variables for image translation:
AZURE_AI_SERVICE_API_KEY="..."
AZURE_AI_SERVICE_ENDPOINT="https://<resource>.cognitiveservices.azure.com/"
run_review es determinista y no requiere configuración de Azure OpenAI, OpenAI o Azure AI Vision.
Notas sobre el comportamiento¶
- Las API de traducción de contenido mantienen la traducción separada de la reescritura de rutas del proyecto. Llame explícitamente a
rewrite_markdown_pathsorewrite_notebook_pathscuando el contenido traducido necesite que los enlaces relativos al proyecto se ajusten para una ubicación de destino. - Las API de orquestación de proyectos añaden comportamiento de proyecto alrededor de la traducción de contenido, incluyendo descubrimiento de archivos, escrituras, reescritura de rutas, metadatos, limpieza y descargos de responsabilidad opcionales.
run_translationimprime resúmenes de progreso y estimación a través de Click, coincidiendo con la experiencia de usuario de la CLI.dry_run=Truecalcula estimaciones usando actualizaciones virtuales del README, pero no escribe el README ni los archivos de traducción.groupsse procesan de forma secuencial. Se imprime una única estimación agregada antes de que comience el trabajo.- Cuando se selecciona la traducción de imágenes, la falta de configuración de Vision provoca un error antes de que comience la traducción.
- Las carpetas de idioma existentes basadas en alias se detectan y pueden migrarse a nombres de carpetas de idioma canónicos como parte de la ejecución.
run_reviewfalla ante archivos traducidos faltantes, metadatos de traducción faltantes o obsoletos, frontmatter/encerramientos de código de Markdown malformados y JSON de notebook traducido inválido.run_reviewinforma como advertencias los destinos locales de enlaces Markdown e imágenes faltantes por defecto.
Ruta de llamada interna¶
The API delegates to the same core implementation used by the CLI:
Translation:
co_op_translator.api.translation.translate_markdown_content,translate_notebook_content, ortranslate_image_contentfor in-memory translation.co_op_translator.api.translation.rewrite_markdown_pathsorrewrite_notebook_pathsfor explicit path post-processing.co_op_translator.api.translation.run_translationfor full project orchestration.co_op_translator.config.Config,LLMConfig, andVisionConfig.co_op_translator.core.project.ProjectTranslator.co_op_translator.core.project.TranslationManager.- Mixins de traducción de proyecto enfocados para Markdown, notebooks e imágenes.
- Traductores de Markdown, notebooks, texto e imágenes bajo
co_op_translator.core.
Review:
co_op_translator.api.review.run_reviewco_op_translator.review.targets.build_review_targetsco_op_translator.review.runner.ReviewRunner- Comprobaciones deterministas bajo
co_op_translator.review.checks
Las siguientes clases son útiles para mantenedores, pero no se exportan como la API estable a nivel de paquete.
| Clase | Módulo | Responsabilidad |
|---|---|---|
ProjectTranslator |
co_op_translator.core.project.project_translator |
Coordina la traducción a nivel de proyecto, la gestión de directorios, la normalización de metadatos por idioma y la delegación a los traductores de Markdown, notebooks e imágenes. |
TranslationManager |
co_op_translator.core.project.translation |
Realiza el trabajo asincrónico de procesamiento de archivos para Markdown, notebooks, imágenes, detección de obsolescencia y actualizaciones de metadatos de traducción. |
ProjectMarkdownTranslationMixin |
co_op_translator.core.project.translation.project_markdown_translation |
Orquesta la lectura de archivos Markdown, la traducción del contenido, la reescritura de rutas, metadatos, descargos de responsabilidad y las escrituras. |
ProjectNotebookTranslationMixin |
co_op_translator.core.project.translation.project_notebook_translation |
Orquesta la lectura de archivos de notebook, la traducción de celdas Markdown, la reescritura de rutas, metadatos, descargos de responsabilidad y las escrituras. |
ProjectImageTranslationMixin |
co_op_translator.core.project.translation.project_image_translation |
Orquesta el descubrimiento de imágenes fuente, la traducción de imágenes, las rutas de salida, metadatos y las escrituras. |
ProjectEvaluator |
co_op_translator.core.project.project_evaluator |
Encuentra pares de Markdown traducidos, evalúa la calidad de la traducción y lee metadatos de confianza para flujos de trabajo de reparación de baja confianza. |
ReviewRunner |
co_op_translator.review.runner |
Coordina comprobaciones de revisión deterministas entre archivos fuente, idiomas de destino y raíces de traducción configuradas. |
ReviewTarget |
co_op_translator.review.targets |
Describe una raíz de origen y el directorio de salida de traducción revisado para esa raíz. |
LanguageFolderMigrator |
co_op_translator.core.project.language_migrator |
Detecta carpetas de idiomas con alias heredados y prepara planes de migración a carpetas canónicas BCP 47. |
Config |
co_op_translator.config.base_config |
Carga archivos .env y comprueba si los proveedores LLM requeridos y Vision opcionales están configurados. |
LLMConfig |
co_op_translator.config.llm_config.config |
Detecta automáticamente Azure OpenAI u OpenAI, valida las variables de entorno requeridas y ejecuta comprobaciones de conectividad del proveedor. |
VisionConfig |
co_op_translator.config.vision_config.config |
Detecta la configuración de Azure AI Vision y ejecuta comprobaciones de conectividad para la traducción de imágenes. |