inditrans

pub.dev License: MIT

A transliteration library for Indic/Brahmic and Latin scripts for Flutter and Dart. Uses FFI on native platforms and WASM on Web for near-native performance, with no server dependency.

  • Available on all platforms (Android, iOS, Linux, macOS, Windows, Web).
  • ITRANS toggle transliteration — wrap any region in ##…## to pass it through unchanged.
  • XML/HTML tag pass-through — tags are never transliterated.
  • Special handling for Tamil, Malayalam, Gurmukhi, and other scripts tuned for readability.
  • Vedic accent support for Vedic scriptures.

Supported scripts

Indic/Brahmic: Assamese, Bengali, Burmese, Devanagari, Gujarati, Gurmukhi, Kannada, Khmer, Malayalam, Oriya, Sinhala, Tamil, Tamil-Extended, Telugu, Thai, Tibetan

Latin/Roman: IAST · IPA · ISO 15919 · ITRANS · TITUS · ReadableLatin

ITRANS notation notes

inditrans implements uniform phonemic vowel mapping adhering to the ITRANS specification:

  • Short vowels: e and o encode short vowels (e.g. Kannada ಎ / ೆ, Telugu ఎ / ె, Tamil எ / ெ, Malayalam എ / െ, Devanagari ऎ / ॆ). ^e and ^o remain supported as aliases.
  • Long vowels: E and O encode long vowels (e.g. Kannada ಏ / ೇ, Telugu ఏ / ే, Tamil ஏ / ே, Malayalam ഏ / േ, Devanagari ए / े).
  • Examples: te $\to$ तॆ / ತೆ, tE $\to$ ते / ತೇ; tere bina $\to$ ತೆರೆ ಬಿನ (Kannada), tErE bina $\to$ ತೇರೇ ಬಿನ (Kannada) / तेरे बिन (Devanagari).

Requirements

  • Flutter ≥ 3.38.10 / Dart SDK ^3.10.8
  • No additional runtime dependencies for transliteration

Installation

flutter pub add inditrans

Quick start

import 'package:inditrans/inditrans.dart' as inditrans;

Future<void> main() async {
  // init() must complete before transliterate() is called
  await inditrans.init();

  final result = inditrans.transliterate(
    "श्री॒ गु॒रु॒भ्यो नमः॒ । ह॒रिः॒ ओ३म् ॥",
    inditrans.Script.devanagari,
    inditrans.Script.tamil,
    inditrans.Options.IgnoreVedicAccents + inditrans.Options.TamilSuperscripted,
  );
  print(result);
}

Configuration

Pass an Option value (or combine with +) as the fourth argument to transliterate():

Option Description
Option.TamilTraditional Traditional Tamil consonants only
Option.TamilSuperscripted Superscripted Tamil consonants
Option.ASCIINumerals Force ASCII numerals in output
Option.IgnoreVedicAccents Strip Vedic accent markers
Option.RetainSpecialMarkers Keep non-standard character markers
Option.NoXMLTagHandling Treat XML/HTML tags as plain text

The skipStart and skipEnd parameters (default "##") mark regions that are not transliterated and are passed through unchanged.

Development

flutter pub get          # install Dart dependencies
dart analyze             # lint and static analysis
flutter test             # run tests (native library must be built)
python3 ../tool/generate_bindings.py  # regenerate FFI bindings after native API changes

Documentation

License

MIT

Libraries

inditrans