Swalekh

Overview

SwalekhWeb is a jQuery plugin that enables Indic typing text fields (<input/>, <textarea/>, <div contenteditable/>) on webpages. Currently supporting 22 Indian languages the plugin supports both Phonetic typing and Virtual keyboard as well.

Supporting Languages

Hindi

Assamese

Odia

Kannada

Bengali

Gujarati

Tamil

Malayalam

Punjabi

Marathi

Telugu

Urdu

Bodo

Dogri

Kashmiri

Konkani

Maithili

Manipuri

Nepali

Sanskrit

Santali

Sindhi

English

Installation

To install Swalekh web follow the steps -

  1. Include jQuery CDN v3.4 or above in your webpage.

  2. Include swalekh.js CDN (Provided by us) in your webpage.

  3. Initialize Swalekh using the following snippet.

$('.yourInputClass').indicInput({
apikey: 'YOUR-API_KEY',
appid: 'YOUR-APP_ID',
apiEndpoint: 'https://revapi.reverieinc.com/',
numSuggestions: 10,
mode: 'keyboard',
domain: 1
})
// You may initialize using either id or classnames

Note: Here, the ‘API Key’ and ‘App Id’ are provided by the Reverie team.

Swalekh APIs

Once your text fields are initialized, you may use the following APIs to change the language or typing modes.

Change Language API

$('.yourInputClass').trigger('change_lang', 'language code')

To capture the change_lang event an additional callback is also enabled for enhanced usage.

Find the appropriate language codes below.

$('.textbox').on('lang_changed', function(event, language) {
// `language` is the current language
})

Change Mode API

$('.yourInputClass').trigger('change_mode', 'phonetic')

Supported Modes

Swalekh Web supports the phonetic and native modes of typing.

To capture the change_mode event an additional callback is also enabled for enhanced usage.

$('.textbox').on('mode_changed', function(event, mode) {
// `mode` is the current mode
})

Language Codes

LanguageLanguage Code

Hindi

hi

Assamese

as

Bengali

bn

Gujarati

gu

Kannada

kn

Malayalam

ml

Marathi

mr

Odia

or

Punjabi

pa

Tamil

ta

Telugu

te

English

en

Urdu

ur

Bodo

brx

Dogri

doi

Nepali

ne

Manipuri

mni

Maithili

mai

Sanskrit

sa

Sindhi

sd

Santali

sat

Kashmiri

ks

Last updated