localization-urdu

majiayu000's avatarfrom majiayu000

Provide per-chapter Urdu translation toggle and manage translated content delivery. Use when translating chapters, caching translations, or implementing language toggles.

5stars🔀1forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

The Localization Urdu skill provides an end-to-end automated pipeline for translating technical documentation into Urdu. It ensures high-quality output by utilizing a specialized glossary for technical terms (such as robotics and AI) and optimizes performance through a checksum-based caching system that only re-processes modified content. This skill is ideal for developers looking to implement bilingual support in documentation frameworks like Docusaurus or enhance RAG systems with localized content.

Use Cases

  • Technical Documentation Localization: Automatically translate Markdown or MDX-based technical manuals into Urdu while maintaining terminology consistency via a JSON glossary.
  • Web Content Management: Implement a per-chapter translation toggle for websites, allowing users to switch between English and Urdu seamlessly with optimized content delivery.
  • Bilingual RAG Systems: Populate vector databases like Qdrant with Urdu translations and language tags to support multilingual retrieval-augmented generation for AI chat widgets.
  • Incremental Content Updates: Use the checksum-based caching mechanism to efficiently update only the translated sections that have changed in the source material, saving API costs and time.
namelocalization-urdu
descriptionProvide per-chapter Urdu translation toggle and manage translated content delivery. Use when translating chapters, caching translations, or implementing language toggles.

Localization Urdu Skill

Instructions

  1. Translation pipeline

    • Extract sections by heading from source Markdown/MDX
    • Translate via OpenAI/ChatKit translation model
    • Keep glossary for robotics terms (JSON file)
    • Cache translations with checksum per section
    • Rerun only when source checksum changes
  2. Storage

    • Option A: Markdown copies (.ur.mdx) alongside English
    • Option B: Neon table translations(section_id, lang, content)
    • Tag Qdrant payload with lang for bilingual RAG
  3. Frontend

    • Add language toggle in Docusaurus layout
    • Load Urdu content when available, fallback to English
    • Ensure chat widget passes desired language to backend
  4. Quality

    • Spot-check key technical terms
    • Allow glossary overrides via JSON config
    • Keep technical terms consistent across chapters

Examples

# Translation function
async def translate_section(content: str, glossary: dict) -> str:
    prompt = f"""Translate to Urdu. Keep technical terms from glossary.
    Glossary: {glossary}
    
    Content: {content}
    """
    # Call OpenAI
    return translated_content
// glossary.json
{
  "Physical AI": "فزیکل اے آئی",
  "Humanoid Robot": "ہیومنائیڈ روبوٹ",
  "ROS 2": "ROS 2",
  "NVIDIA Isaac": "NVIDIA Isaac"
}

Definition of Done

  • Translation pipeline runs and caches results; reruns are incremental
  • Urdu toggle renders translated sections for at least one sample chapter
  • Backend can return Urdu-context answers when requested