Transliterator

Transliteratior (formerly known as ToCyrillic or Кириллизатор) is a Firefox / Thunderbird / etc extension which provides transliterated keyboard input mode and transliteration/detransliteration of document text.

Transliterator is compatible with Firefox, Thunderbird, Seamonkey 2, Sunbird, NVU / KompoZer, Songbird and Instantbird. Support for other mozilla-based application may be added in the future / by request.

The current version is 0.7.5.

Install from mozilla addons site

download from this server if your application is not supported by the installation package at the above link

What does it do?

Translit Input Mode

Transliterator intercepts your keyboard input and de-transliterates it. It is very useful when you do not have the keyboard configuration required to enter text in your desired alphabet. The mappings could be one-to-one (one keystroke for one letter) or many-to-many. For example, the Russian transliteration table contains the following pairs:
roman cyrillic
s с
sh ш
c ц
ch ч
shch щ
To enter letter щ, you will have to type in 4 keystrokes, and the text you see in the input box will be as follows:
typed letters result
s с
(s)h ш
(sh)c шц
(shc)h щ
This feature is available in all editable areas of the application: search box, url bar, bookmark manager, etc, and in all text fields of the loaded web pages, e.g. gmail. To enable it, choose Translit Input Mode from the edit menu (if available) or hit F2. The affected area will be surrounded by a dotted blue border.

Detransliterate

Convert text from transliteration  to the desired alphabet. Useful if, for some reason, you forgot or were unable to use the input mode, or if someone posted on a forum using transliteration and you'd rather not break your eyes on the gobbledygook ;). The detransliteration follows the same mappings as the input mode. Keep in mind that since the rules for transliteration of different languages may be flexible, your mileage with detransliterating arbitrary text will vary.  To use this feature, highlight a paragraph of text with the mouse and choose Edit -> Detransliterate from the menu or hit Ctrl+Shift+Q. 

Transliterate

Convert text to the transliteration of its original alphabet. Use this when you do not have the font required for viewing this alphabet, or you need to send this text using the means not compatible with unicode (e.g. console-based e-mail or SMS). Transliteration feature  uses the same rules as the input mode and detransliteration, but follows them in inverse order. To use this, highlight some text and choose "Transliterate" from the Edit menu or hit Ctrl+Alt+Shift+Q.

Here is an online version of this transliterator for cyrillic alphabet: http://www.benya.com/cyrillic/.




Configuration

All transformations mentioned above are performed according to the selected transliteration layout. To change this layout, open the options dialog, accessible by choosing Tools -> Transliterator Options in the menu or by right-clicking on the extension listing in the addons manager. Choose the desired layout from the drop-down list and click View to preview it.

You can also change the menu labels and the corresponding shortcuts. To change the shortcut, hit the desired key combination while your cursor is in the appropriate edit box.

As of version 0.7, the following layouts are packaged with the extension (please note, the names of the layout are at the discretion of their contributors):
  • Bulgarian Extended
  • Bulgarian Translit
  • Беларускі Трансліт
  • Customized Serbian Latinica
  • Georgian/Kartuli (ქართული) translit & typing
  • Kazakh - QazTranslit.com
  • Macedonian - English Letters
  • Macedonian - Unicode
  • Macedonian Latinica
  • Ukrainian - translit.ru
  • (Cherokee transliteration)
  • Обыкновенная Латиница (default)
  • Phonetics (X-SAMPA)
  • Phonetics (Kirshenbaum)
  • Phonetics (dk.kultur.sprog)
  • Русская Транслитерация - translit.ru+
  • Русская Транслитерация: ГОСТ 7.79-2000
  • Стандартная Русская Клавиатура ЙЦУКЕН
  • Фонетическая раскладка яЖерты
  • 台灣/闽南白話字 (Taiwanese POJ)
  • ひらがなとカタカナ (kana)
  • Pīnyīn
  • Greek / Latin
  • Esperanto
  • Pali Velthuis to Unicode
  • Serbo-Croatian (Latin)
  • Russian for AZERTY keyboard
  • Kyrgyz
  • Karakalpak
  • Roman to Devanagari transliteration
  • Russian for German keybards
The layouts are customizable and user-editable (see below for instructions). If you can create a layout for a language not yet supported by transliterator, please create and contribute!


Version History

version 0.7.5
  • compatible with Firefox 4
  • Armenian layout
version 0.7.4
  • Preferences dialog changes: F2 instead of VK_F2, etc
  • Treat backspace characters as valid input where possible (no reverse mapping)
  • Roman to Devanagari mapping (Anunad Singh)
  • Russian for German Keyboards (Pawel Sirotkin)
  • Minor change to default Russian mapping
version 0.7.3
  • new layouts: Kyrgyz, Karakalpak

version 0.7.2
  • new layouts: Georgian typing, Esperanto, Pali, Serbo-Croatian (Latin), Russian for AZERTY keyboard

version 0.7.1
  • added greek, kana, pinyin layouts
  • fixed a bug that prevented transliterator from working in more than 1 field at the same time.
  • better clean-up on document load/unload
version 0.7.0.1
  • Complete rewrite.
  • Renamed to Transliterator
  • Case-sensitive mappings
  • Transliterator now attaches to all application windows, including other extensions
  • Layout viewer
  • Added IPA & Belarusian, tweaked other layouts
  • Compatible with firefox, thunderbird, songbird, sunbird, NVU / KompoZer, Seamonkey 2, instantbird
See this page for versions prior to 0.7

Custom Transliteration Tables

Creating new layouts

A transliteration table consists of pairs [source, target], where the source is a string in the local alphabet (matching your keyboard), ad the target is in the alphabet you expect to produce. For example, writing in Russian on a US-English keyboard using the phonetically similar letters and combination of letters requires mappings A -> А, B -> Б, etc.

The target alphabet may have more letter than the source alphabet, and some target letters may require more than one letter in the source alphabet. In fact, sometimes it may be necessary to map a group of source letters to a group of target letters. Therefore, transliteration table pairs can map a string of arbitrary length to another string of arbitrary length. For example, YO -> Ё, Y\O -> ЫО (Custimized Russian) or ann -> aⁿ, ann7 -> āⁿ (Taiwanese POJ)

When creating a multi-character mapping, it is important to keep in mind the unintended consequences such as this: given a mapping a->x, b->y, ab->z, it will be very hard to enter xy

There may be more than one way to transliterate a string. For example, cyrillic Х may be transliterated as H or KH, and cyrillic Я - as YA or JA. The transliteration tables for this extension accomodate this by allowing multiple source mappings for the same target string. This will allow a target string to be entered in more than one way, while the transliteration will use the first encountered mapping. In other words, using the example above, the mappings KH->Х and H->Х will allow two ways to enter Х, but Х will always be transliterated as KH.  Similarly, it is possible for one source string to be mapped to multiple targets.  In such case the multiple mappings will not apply in the input mode.

By default, a lowercase source letter maps to a lower-case target letter, and uppercase to uppercase. Therefore, it is not necessary to include both x->y, X->Y. This may not be practical in situations where the target alphabet does not have the concept of upper or lower case. To resolve this, the entire transliteration table may be designated as case-sensitive, and will allow mappings x->y, X->z

If the source string does not have an upper or lower case (e.g. ' or #), it is possible to have the transliterator attempt to guess the correct case for the target string. The logic for this guess is as follows: the result is always lower case unless followed by an uppercase letter, or, if at the end of a word,  preceded by at least two uppercase letters. This algorithm always errs on the side of lower case, so may be a good idea to have some way to enter upper case as well. This exception was implemented with Cyrillic "Ь" in mind, but may be useful for other languages as well.

Adding and testing layouts

The format of the transliteration table is a javascript array of arrays of strings: [ [source, target], [source, target] .... ]
For example: [ ["a", "а"], ["b", "б"], ["v", "в"] ]

The exception for automatically guessing the case is entered using keyword "true" in the 3rd position of the element  [ [source, target], [source, target, true] ...]
For example [ ... ["##", "Ъ"], ["#", "ъ", true] ...] - map double-pound sign to an uppercase letter, have single pound sign match the case of the target string to surrounding text.

The array is passed as is to javascript eval function, so it is important that it is parsed correctly. Any double-quotes (") and backslashes (\) need to be escaped by backslashes, e.g. [ ... ["\"", "ш"], ["\\", "э"] ... ]

To add a transliteration table to firefox (or other apps), you need to follow these steps:

1. Open firefox configuration editor (type about:config in the location field), then filter the preferences by "transliterator".
2. Come up with a unique identifier for your new layout, something composed of only letters and numbers (e.g. myconfig)
3. Right-click on the configuration editor, choose New -> String, enter preference name extensions.transliterator.layouts.myconfig, hit enter, paste your transliteration table
4. Right-click and add new string again, this time enter extensions.transliterator.layouts.myconfig.description and a name for your transliteration table, e.g. "My extra special configuration"
5. To enable case sensitivity, add a new boolean preference extensions.transliterator.layouts.myconfig.case_sensitive and set it to true.

Now, if you open the options dialog, you should be able to see your layout in the list. If it does not apper, open the Error Console, typically located in Tools menu, and see if it contains any useful information. 

If you feel that your new layout will be useful to the rest of the world, please send it to me by e-mail.




a->А k->К kh->Х
b->Б l->Л c->Ц
v->В m->М ch->Ч
g->Г n->Н sh->Ш
d->Д o->О shch->Щ
e->Е p->П `->Ъ
yo->Ё r->Р y->Ы
zh->Ж s->С '->Ь
z->З t->Т e'->Э
i->И u->У yu->Ю
j->Й f->Ф ya->Я






Contact Info

Please discuss the extension and make feature requests at the extension page on mozilla addons site. Please send bug reports by e-mail