You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use existing OpenAI integration to translate content on demand
Add a translations table to cache results (translate once, serve forever)
Pros: No manual translation effort, uses existing API key, good Urdu quality from GPT
Cons: Initial load delay for uncached content, API cost for first translation
Option B: Store real Urdu translations in the database
Add Urdu columns/rows to existing tables (documents, bills, proceedings)
Manually translate or bulk-translate content
Pros: Instant load, verified accuracy for legal text
Cons: Significant translation effort, ongoing maintenance for new content
Option C: Hybrid
Use Option A as the default, allow admins to override with verified translations (Option B)
Best of both worlds but more complex
Pages NOT translated (internal/admin):
/admin/dashboard
/admin/upload
API error responses
Technical Details
Package:next-intl@3.x (compatible with Next.js 13)
Routing: Prefix-based, localePrefix: 'as-needed' (no prefix for English default)
Font: Noto Nastaliq Urdu (Google Fonts)
RTL:dir="rtl" on <html>, Tailwind logical properties
Why This Matters
Pakistan has two official languages. Most citizens are more comfortable in Urdu. Making constitutional and legal knowledge accessible in Urdu directly serves Numainda's mission.
Summary
Add complete Urdu translation support to Numainda, making Pakistan's constitutional knowledge accessible in both English and Urdu.
Scope
Phase 1: Static UI Translation (next-intl)
Use
next-intl(v3.x) with prefix-based routing (/about= English,/ur/about= Urdu).Infrastructure:
next-intl, configurenext.config.mjsi18n/config (routing, request, navigation)middleware.tsfor locale detectionapp/[locale]/(API routes stay outside)messages/en.json+messages/ur.jsonTypography & RTL:
lib/fonts.ts)lang,dir, and fontml→ms,pl→ps, etc.)line-height: ~2.2)String replacement (~500 strings across all pages/components):
UI:
dir="auto"for mixed-language typingPhase 2: Database Content Translation
For dynamic content from the database (bill summaries, proceedings, constitution text), two approaches are on the table — decide which to pursue:
Option A: AI-powered on-the-fly translation (with caching)
translationstable to cache results (translate once, serve forever)Option B: Store real Urdu translations in the database
Option C: Hybrid
Pages NOT translated (internal/admin):
/admin/dashboard/admin/uploadTechnical Details
next-intl@3.x(compatible with Next.js 13)localePrefix: 'as-needed'(no prefix for English default)dir="rtl"on<html>, Tailwind logical propertiesWhy This Matters
Pakistan has two official languages. Most citizens are more comfortable in Urdu. Making constitutional and legal knowledge accessible in Urdu directly serves Numainda's mission.
🤖 Generated with Claude Code