Asteco Corporate Communications
Arabic Translation Portal
An English-to-Arabic workspace that keeps the source as the only source of facts, holds Asteco's approved terminology and tone, and checks every draft with a second model before it ships.
975
Paragraphs Extracted
Parsed from seven approved references in their original order
419
Bilingual Pairs
Candidate English and Arabic pairs identified for the style library
3
Reference Examples Max
Only the most relevant approved examples are ever sent to the model
2
Word Export Formats
Arabic-only RTL, or bilingual with aligned English and Arabic
The Problem
The Problem
Corporate translation is not word replacement. A resident notice or a formal letter has to stay factually exact while carrying the terminology, formality, and sentence structure the organisation already uses.
Done ad hoc, the risks stack up: literal Arabic that reads unnaturally, terminology that drifts between communications, dates and numbers that quietly change, and facts from an old reference document bleeding into a new one, all while confidential source files and AI costs have to stay controlled.
The brief was a workspace that produces natural, on-brand Modern Standard Arabic from an English source, with the English treated as the only factual input and every draft reviewable before it leaves the tool.
What I Built
What I Built
I designed and built the full application with Claude Code: the workflow and interface, the server-side OpenAI integration, document extraction, reference retrieval, the translation and refinement prompts, the structured quality report, and the Arabic and bilingual Word exports. Three areas carried most of the work.
Source-Grounded Translation
Treated the English document as the only factual source, so approved communications shape tone and terminology while their facts never enter a new translation
Built relevance scoring that sends at most three approved examples per request instead of the full reference library
Separated the curated style guide, glossary, and protected terms from factual input, so the model localises the voice without inventing content
Independent Quality Review
Added a second AI request that compares source and translation and reports missing or added meaning, number and date mismatches, grammar, and terminology drift
Enforced the report shape with Zod-backed Structured Outputs, replacing hand-parsed JSON that can silently break
Kept the review read-only: it scores completeness and flags issues, but never edits the translation automatically
RTL Output and Cost Control
Generated Arabic-only and bilingual Word documents with bidirectional paragraphs, right-to-left runs, and Arabic-aware alignment, preserving headings and lists
Calculated real per-request cost from actual API usage across cached input, cache writes, output, and reasoning tokens, shown as latest-run and session totals
Kept the OpenAI key server-side, validated every upload, and set the API to store nothing, so documents are never retained by the model provider
How It Works
A Draft Pass, Then an Independent Review
The workflow is deliberately human-in-the-loop. The English source is drafted and grounded first, then a separate model reviews the Arabic against it, and nothing is exported until a person has seen both.
Draft — grounded in the English source
Extract
Paste English or upload a DOCX, PDF, or TXT; the portal extracts the text and preserves paragraph order
Configure
Choose the communication type, tone, and translation mode before anything is sent to the model
Translate
The model drafts Modern Standard Arabic grounded only in the English source, guided by the approved style set
Refine
Apply controlled refinements for fluency, formality, or simplification, editing either language directly
Review — independent and read-only
Quality check
A second AI request compares source and translation and returns a structured completeness report
Review
Read the flags for meaning, numbers, dates, grammar, and terminology; the report never changes the draft
Export
Export an Arabic-only RTL document or a bilingual file with aligned English and Arabic
Key Features
What It Produces
Reference-Guided Translation
A curated style guide, glossary, and protected terms, plus up to three relevant approved examples, steer the Arabic without ever sending the whole reference library.
Document Processing
DOCX, PDF, and TXT uploads validated by type and a 10 MB limit, with paragraph order preserved and image-only scans rejected rather than silently mistranslated.
Translation Controls
Communication type, tone, and mode (faithful, natural, or brand style) are set before generating, with controlled refinements for fluency, formality, or simplification.
Independent Quality Report
A separate AI pass scores completeness and flags missing meaning, number and date mismatches, grammar, and terminology drift, using schema-enforced Structured Outputs.
Arabic and Bilingual Word Export
Arabic-only RTL documents, or bilingual files with aligned English and Arabic columns, preserving headings, lists, and text direction where possible.
Live Cost Visibility
The estimated cost of the latest run and a running session total, calculated from real token usage across input, cache, output, and reasoning.
Engineering Challenges
The Hard Parts
Preventing Reference Leakage
Reference communications hold real facts, so sending them whole could bleed old details into new copy. I split factual input from style context and score relevance to select only a small approved subset.
Reliable Quality Reports
Free-form JSON occasionally violates its expected shape. I moved to the SDK Zod-backed Structured Outputs parser, so the API itself enforces the quality-report schema.
Arabic Document Formatting
Arabic export needs more than right-aligned text. The generator applies bidirectional paragraphs, right-to-left runs, Arabic-aware alignment, branded headings, and bilingual tables.
Honest AI Cost
Character counts do not reflect billing. Each run is priced from actual usage, including cache reads, cache writes, and reasoning tokens at each model rate.
Security and Privacy
Boundaries Built In
The tool handles confidential corporate documents, so the privacy boundaries were part of the design, not an afterthought.
The OpenAI key stays server-side and never ships in browser code
Reference documents live outside the public directory, and .vercelignore excludes secrets, references, and internal instructions
Uploaded document contents are never written to application logs
Every request and upload is validated on the server before it reaches the model
Requests run with storage disabled, and private demos sit behind Vercel authentication
Built With
Built With
English in, Modern Standard Arabic out: grounded in the source, held to the approved voice, and checked by a second model before anyone sends it. The portal makes AI a controlled drafting and review layer, not an unquestioned replacement for professional judgement.