Tuesday, 18 March 2014

Indian Language support on Firefox OS using jquery.ime

Firefox OS is coming! With the announcement of the $25 phone at MWC, there is much excitement and wait for the launch of Firefox OS phones in India.
But the software is far from feature-complete for the complex Indian market. A major task for the platform to be a "People's phone" is to know their languages!
Localisation of Firefox OS is a very big task up ahead. One of the tasks is user input in Native Indian languages. Support for most Indian languages are already present on platforms like Android.

I've recently been experimenting with Language Computing using a few SMC projects. So I thought why not build an Indian Language IME for Firefox OS. I also proposed the idea to SMC for the GSoC program.
The idea was welcomed by the mentors and one of the mentors, Anivar, asked me to do a feasibility study on the use of jquery.ime library.

The jquery.ime is an input method editor library supporting more than 135 input methods across more than 62 languages.

While jQuery is a great framework to kickstart web development with multiple browser support without any worries, there arises use specific use cases when this may not be required. The biggest example is its use in Firefox OS. Since the OS runs Gecko, there is no use of the extra Javascript code for cross-browser support. I am planning to port the jquery.ime library to plain vanilla Javascript. This would enable developers using modern frameworks like AngularJS and EmberJS to take advantage of the ime's without having a dependency on the jQuery library.

For testing the feasibility, I thought of quickly hacking up an IME for Hindi, which is the Indian Language I'm most comfortable with. Implementation relating to the OS was easy enough, and I tweaked the Keyboard settings to include 'Hindi' keyboard as one of the options.

The IME is not perfect as such and there are a lot of problems in the input, especially when the words become large. I 'm sure that can be sorted out and since I'm not familiar with IME's it would be a good learning point as well.

Fortunately, there is no need of resetting Gaia on my Keon again and again and testing can be done on Firefox Nightly. Here's a demo of the Hindi IME.

The code structure of jQuery.ime is very neatly organised and this quick hack definitely means that with proper manipulation, jQuery.ime would enable not just Indian Language support but most of the 62 different languages supported by the library in Firefox OS.

The major task in the project will be to convert all the jQuery specific code into JavaScript, while maintaining cross browser support (for use in other projects).
After that I feel it will be relatively easier to introduce most of the input methods available in jQuery.ime in Firefox OS. There is a lot of routine work to be done with all the different IME's, so I'm also planning on a Automatic porting tool, written in Python to generate the required folders and populate them with the requisite files containing Patterns of the various languages.

Looking forward to the project.

Update : Although the IME is not complete, the Proof of Concept code is available here : https://gist.github.com/psbots/aa1887f0a53c61611061


  1. We are regular reader of your blog and we are waiting next update Rosemount offers a comprehensive General Hindi Language course to professionals who want Intensive Hindi Language Course depth understanding of the languages get in touch with us.

  2. Firefox is the very flexible and friendly browser for the developers specially. Thanks ..

    Firefox Tech Support
    Firefox Technical Support