Introduction

Welcome to UrduMagic, the high-performance solution for adding seamless Urdu language support to any web project.


What is UrduMagic?

UrduMagic is a high-performance TypeScript library (~222KB gzipped) designed to make the web accessible to Urdu speakers worldwide. Whether you want to provide transliteration between Roman Urdu and Urdu script or offer full English-to-Urdu translation using its 10,000+ entry offline dictionary, UrduMagic makes it seamless.


Why UrduMagic?

Urdu is one of the most widely spoken languages in the world, yet it remains underrepresented in modern web development. Most sites either ignore Urdu script or struggle with the complexities of RTL (Right-to-Left) layouts and script detection.

UrduMagic was built to deliver:

  • Offline First: Massive 10,000+ entry dictionary for instant lookup performance without external network latency.
  • Optimized Pipeline: High-speed translation flow (Dictionary → Cache → DOM Mutation).
  • Hardened Security: Built-in XSS protection and prototype pollution prevention.
  • Magic Mode: Automatically scans and switches visible text on your page with zero manual wiring.

Key Features

Custom Vocabularies

Easily inject your own brand names or website-specific terms using extendDictionary.

Missing Word Collector

Built-in, privacy-focused tool to track and discover missing translations on your site.

Beautiful Typography

Automatically injects and applies Google's Noto Nastaliq Urdu font for perfect readability.

100% Offline First

Transliteration logic and dictionary lookups run entirely in the browser with zero cloud dependencies.

RTL by Design

Automatic Right-to-Left bidirectional layout switching with full DOM subtree isolation.

Smart Script Detection

Automatically detects whether input text is English, Urdu script, or Roman Urdu.

Dictionary Driven

Powered by a local 10,000+ entry English-Urdu mapping with O(1) instant memory lookup.

MIT Licensed & Secure

Free and open source for everyone with built-in XSS protection and prototype pollution defense.


Ready to get started? Check out the Quick Start guide →