The BarBar Transliterator

Pease note that typing fast makes character combinations to be interpreted accorging to the keymap table on the right. To make a character be interpreted individually put a delay between characters that are combination members. more

faq

welcome - general information about this project,
news - new staff,
user how-to - a simple guide on unsing barbar,
developer how-to - everything you should now about barbar as a developer,
keymap howto - write your keymaps,
downloads - download barbar and other staff,
features - feature overview,
todo - what is to come,
barbar - a few words about the name,
links - links to resources,
feedback - contact me.

welcome

The Barbar Transliterator project aims to provide online trasliteration service and addon trasliterator scripts for web-developers and web-users.
The transliterator script that works on this site is a javascript application that is easily added to a website and extends the functionality of exisiting textareas to provide input transliteration.

By now, Armenian <–> Latin, Russian <–> Latin, Turkish <–> Latin, transliteration is provided and more to be added soon. If you are interested in some particular transliteration pair to appear on this web site, write a trasliteration keymap of your own and post it to me with a short comment so I can add it to this website. Read on the keymaps or details how to define a keymap.

Web-developers may whant to read the developer howto to find out how you may add Barbar to your web project.

news

  • (7.5.2008) The last map used is stored as a cookie and set on next visit.
  • (6.5.2008) Russian and Turkish added.
  • Safari 2 is now supported. Safari 3 should also work, though I didn't test yet. IE6-7 support to be added next.

user how-to

Transliteration is the process of translating input characters or character combination to different characters. Barbar does this according to the selected keymap that is selected from the dropdown above the textarea.

The keymap table on the right of the textarea shows the current translation sheme. You will notice there are single character translations or character combinations that are translated to one or more characters. This is due to the fact that the number of the input characters and target characters differ usually to some or other extent.
As a result one character may appear in the keymap on it's own and as a member of a character combination.

Puting a short delay while typing characters that are members of a combination you avoid the combination beeing interpreted, otherwise the combinations result in composite translation.

To translate a portion of text pasted into the textarea hit the TRANSLITERATE button to translate the whole content of the textarea, or select a portion of text to restrict the action. Already translated parts will remain untouched.

developer how-to

As a web-developer you may whant to integrate Barbar into your web-project. At this point you'll need to load two scripts in the header of a html document the prototype.js (first) and the Barbar.js found in the download archive.

The BarBar is activated calling "new BarBar();" on body.onload (or window.onload). Then it looks for textareas in the document with a barbar="" attribute defined and registers itself as an event listener and handles the rest. The value of the "barbar" attribute may be a JSON string. At the moment few options are interpreted but more is to be added soon.

If you may wish to have a toolbar and a keymap table, you define to empty container nodes (html tags) in your document at any desired place define uniq id-s on them and put them into appropriate fields of the json string: barbar="{'toolbar': {'nodeId': 'btoolbar'}, 'keymap': {'nodeId': 'bkeymap'}}", the source code of this site may serve you as a good example.

There may be one or more textareas defined in this way and they will work independently of each other.

There is much more one could extend or add to the Barbar in a simple manner. Barbar is a modular application, so if you need some kind of additional functionality or UI you define an additional module. There is no documentation on this, but if you counsider extending Barbar take a look how Toobar and Keymap modules are defined to get an idea.

keymap how-to

Keymaps are defined as object structures in BarBar.prototype.settings.maps. Here an incomplete example:


{
    'default':  true,
    'key':      'lat_to_hay',
    'name':     'Latin -> Armenian (Unicode)',
    'autor':    'Levon Ghazaryan',
    'version':  '1.0',
    'date':     '7.3.2008',
    'comment':  'Latin to Armenian Unicode transliteration map\n' +
                'all letters are defined in latin characters\n' +
                'resp. character sequences and though non letter\n' +
                'symbols remain untouched.',
    'map':
    {
        'a':    'ա',
        'b':    'բ'
     }
}
                    
The keys of BarBar.prototype.maps[0].map are the selector characters that are translatet, the corresponding values the translation targets. Selectors that start with the same character or the same characters combination define a complex translation, so the selector may have any number of characters as good as the target that might also be any number of characters, though keep in mind, keeping targets short makes typing easier.



If you wrote a keymap and whant it to be added on this site, send it to me in an email with a short comment who you are and what should this keymap be good for, though keep in mind - you map should be properly encoded in unicode, so you'll have to use any editor like jedit or similar. Please send me no word or other rich text documents, this will not do.

If you what to add a keymap localy on your site, extend the BarBar.prototype.settings.maps array structure in your version of BarBar.js.

features

  • transliterate a selection or the whole content,
  • transliterate as typed,
  • selectable transliteration keymaps: unlimited keymaps may be loaded, loaded keymaps may be switched between,
  • easy to extend with own keymaps,
  • simple integration into web applications,
  • UI appearance adjustable with CSS, minimal to no restrictions to the postion or html of the UI containers,
  • UI widgets beside the textarea are optional,
  • UI extendable: you may choose to write a widget of your own. BarBar.Keymap or BarBar.Toolbar are a good starting point for this.
  • Firefox 2 supported
  • Safari 2 supported

todo

  • review the prototype dependency,
  • add a field to adjust the delay needed to avoid composite translation,
  • document more features,
  • complete the documentation,
  • add more keymaps,
  • save settings for this site in cookies,
  • test in more environments

barbar

links

feedback

write me your wishes, bug reports and other staff to: nospam at demiurg dot org.