Skip to main content
A
Docs

Translate

Sovereign document translation engine with domain specialization, translation memory, and glossary management.

Overview

Anar Translate is a sovereign document translation engine purpose-built for GCC government organizations. It provides Arabic-English translation with domain specialization across legal, technical, administrative, medical, and financial content -- powered by sovereign AI models that keep data within your infrastructure.

Government translation workflows demand more than generic machine translation. Legal contracts, policy documents, technical specifications, and ministerial correspondence each require domain-specific terminology and consistent phrasing. Translate addresses this with translation memory, glossary management, and domain-aware prompting.

Key Capabilities

Domain-Specialized Translation

Every translation request specifies a domain that shapes the AI model's output. Six domains are supported:

DomainUse Case
generalGeneral-purpose text
legalContracts, regulations, court documents
technicalTechnical specifications, IT documentation
administrativeGovernment correspondence, ministerial memos
medicalHealthcare records, clinical documents
financialBudget reports, audit documents, financial regulations

Translation Memory

Translation memory (TM) stores previously translated segments for reuse. When new text contains segments similar to past translations, the TM provides suggestions with fuzzy matching scores, ensuring consistency across documents and reducing redundant AI calls.

Glossary Management

Glossaries enforce consistent terminology. Define source-target term pairs scoped to a domain and language pair, and Translate applies them during translation. This ensures that legal terms, government titles, and technical jargon are always translated the same way.

Document Translation

Upload entire documents (PDF, DOCX, TXT) for end-to-end translation. Translate segments the document, translates each segment with domain awareness, and returns the complete translated text with progress tracking.

Language Detection

Automatic language detection identifies the source language with confidence scoring and script identification, enabling auto source language for workflows where the input language is unknown.

Glossary Batch Operations

Import and export glossary entries in bulk. Batch create, update, and delete glossary terms across domains for efficient terminology management at scale.

PII Check

Integrated PII detection scans source and translated text for personally identifiable information before output. Flags or redacts sensitive data to ensure translations comply with data protection requirements.

Translation Statistics

Dashboard analytics showing translation volumes, domain distribution, quality score trends, token usage, and language pair breakdowns over configurable time windows.

Guard Telemetry

When connected to Anar Guard, Translate reports LLM call telemetry for centralized governance monitoring and cost tracking.

Architecture

Translate runs a FastAPI backend on port 8012 and a Vite+React dashboard on port 3012.

The backend includes the core translation engine (LLM-powered with domain prompts), translation memory (fuzzy matching, TMX import/export), glossary management (multi-domain term enforcement), and document processing (segmentation, batch translation).

Supported Languages

Translate currently supports Arabic (ar) and English (en) as source and target languages, with automatic language detection.

Quick Start

cd translate/backend
uv sync
uv run uvicorn anar_translate.main:app --reload --port 8012

Translate a text:

curl -X POST http://localhost:8012/api/v1/translate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "text": "يجب على جميع الجهات الحكومية الالتزام بمعايير الأمن السيبراني",
    "source_lang": "ar",
    "target_lang": "en",
    "domain": "administrative"
  }'

Dashboard

The Translate dashboard provides:

  • Translation Console -- Interactive text translation with domain selection and language detection
  • Translation History -- Browse, search, and filter past translations by domain and language
  • Translation Memory -- Manage TM entries, import/export TMX files, and review fuzzy match scores
  • Glossaries -- Create and manage domain-specific glossaries with term pairs and batch operations
  • Statistics -- Translation volume charts, quality trends, domain distribution, and token usage analytics

Observability

Translate is instrumented with OpenTelemetry via anar_shared.setup_otel(). When OTEL_EXPORTER_OTLP_ENDPOINT is set, traces, logs, and metrics are exported to the OTel Collector.

MCP Server

Translate exposes a Model Context Protocol server at /mcp via FastApiMCP, enabling AI assistants to translate text, manage glossaries, and query translation memory programmatically.

Gateway Integration

When GATEWAY_URL is set, Translate routes LLM calls through Anar Gateway for unified cost tracking and safety scanning.

Test Suite

403 tests cover translation engine, translation memory, glossaries, glossary batch operations, batch processing, PII detection, language detection, translation statistics, telemetry, and API endpoints.

cd translate/backend && uv run pytest

Next Steps