Writings Photos Code Contact Resume Me
Arabic Hildon Input Method

You are here

Submitted by msameer on Tue, 11/12/2007 - 11:53am

HIM Arabic plugin is on its way.

The code is available from my svn repository

svn co http://home.foolab.org/svn/projects/him-arabic/trunk/ him-arabic

* The code is UGLY. A lot of the functionality is still missing.
* No packages yet. I'll create them but my cold doesn't help much :-)
* The above screenshot is for scratchbox not for the actual device. I didn't try yet to run it on the device.
* You will also need an Arabic font. I packaged one here: ftp://foolab.org/pub/apt/pool/arabic/t/ttf-kacst/ttf-arabic-kacstbook_1.6.2+mry-1.0.1_all.deb

I know there's one provided by the browser team. It was me who did the packaging for it but I'll be providing multiple fonts soon so ttf-arabic is now a virtual package.



Submitted by Mohammad (not verified) on Tue, 11/12/2007 - 1:11pm

Sweet! :-)

Submitted by rg (not verified) on Tue, 11/12/2007 - 3:29pm

Hi mohammed, great work - do you think there is an easy way to get this working with hebrew input also? I have already packaged the hebrew culmus fonts, perhaps they would work with your input method? Thanks in advance for any input...

Submitted by msameer on Tue, 11/12/2007 - 4:43pm

Thanks for your words.

The layout is defined in an XML file.
I've just implemented the ability to "render" 4 layouts that are defined in the XML file.
* mode_a pressed and mode_b pressed
* mode_a released and mode_b pressed
* mode_a released and mode_b released
* mode_a pressed and mode_b released

The problem is there's no way to configure the plugin.

I can simply reserve one of the 4 layouts for Hebrew. How many letters are there in Hebrew (Sorry for the stupid question) ?

Submitted by rg (not verified) on Tue, 11/12/2007 - 9:21pm

In hebrew there are 22 main letters plus 5 final letters, so 27 in total - the normal keyboard layout is like http://www.qsm.co.il/Hebrew/keyboard.htm, if you explain how I can help you make the XML data for hebrew I would be glad to - im setting up scratchbox right now to try compile your input plugin...

Submitted by msameer on Tue, 11/12/2007 - 9:33pm

The XML is easy:

<?xml version='1.0' encoding='UTF-8' ?>
<layout mode_a="1" mode_b="0">
<key name="'" expand="0" />

mode_a = 1 (Activate when mode_a is activated)
mode_b = 0 (Don't activate this layout if mode_b is active)
For each row in the layout you need keys.
Each key has a name "Which is the string that will be inserted when it gets clicked too" and an expand attribute.
if expand = 1, the key will try to fill the space in the GtkVbox. If 0 then it won't.

Problem is we are limited to 4 rows for Arabic and 5 for English. That's why I'd to move the numbers to a different layout (I updated the code). but that'll be enough for hebrew (Arabic has +28 letters).

The problem'd be fitting the digits somewhere ?

Submitted by msameer on Tue, 11/12/2007 - 9:42pm

OK. I moved the digits to the Arabic keyboard. We now have a complete empty section that can be used for anything.

I don't mind including Hebrew. It just feels a bit odd to include Hebrew in the "Arabic input method". Fine with me though :-)

Submitted by rg (not verified) on Tue, 11/12/2007 - 10:43pm

Yeah it does seem a bit strange to have hebrew in arabic input method, but its fine with me also - maybe a glimpse of a future more peaceful world :-) Both of them are useful for me as I use hebrew daily but am now learning arabic.

Another idea might be to either clone your plugin and add hebrew separately - or perhaps call it RightToLeft input methods or something similar but whichever way is good with me as long as hebrew/arabic input is available on maemo some way... I think starting with the languages combined as you have done is good (as I am not a good coder yet :-)), perhaps I can help separate them in the future once my C/C++ skills get a little better.

I'm taking a look at the XML files to try and make a hebrew keyboard layout but I can't get the input method to show in scratchbox/xephyr after i've compiled it and done make install - only the english keyboard is available as an input language. Do I have to change anything to activate the arabic input method?

Thanks for the quick replies - there are a few people I know who would be overjoyed if this input method works for hebrew and also in arabic as many of my friends and colleagues speak/use both regularly...

Submitted by msameer on Tue, 11/12/2007 - 10:57pm

./configure --prefix=/usr is your friend :)
You also need to run "hildon-im-recache"
keys.xml should be in /usr/share/him-arabic/
him_arabic.so should be in /usr/lib/hildon-input-method/

You then need to activate it from the menu.

The code is not really that good. I wrote it while having cold :)
The API forces me to code in a certain way too.

Anyway, let's get it done and later we can see what improvements are needed.

Submitted by rg (not verified) on Thu, 13/12/2007 - 1:31am

Thanks to your excellent help, I got hebrew input working on scratchbox and also on the N800 under OS2008 beta. I can upload the keys.xml file (svn commit perhaps) if you want to include it, for the moment heres a screenshot from the N800:


The text in hebrew says 'Shalom and thanks to Mohammed Sameer who helped to get hebrew on the N810' :-)

Submitted by msameer on Thu, 13/12/2007 - 9:45am


Now that I've actually used the 4th free layout to add more Arabic symbols, I thought about using the languages menu to toggle both languages. This gives you an additional layout that you can fill ?

I'm still working on that. Problem is that the SDK doesn't provide an interface to set the secondary language so I'm still trying to figure out how.

I'm sorry but I don't give anyone access to my personal svn repository (I know this is anti-FOSS but it's my personal one ;-)). You can email me the file and I'll include the layout and credit you.


P.S. The code and data files are under the GPL.

Submitted by Yasin (not verified) on Thu, 13/12/2007 - 2:16pm

Selam Mohammed :)

Excellent work. Can you possibly package up a phonetic keyboard using English characters (that types in Arabic) in a similar vain to this: http://zsigri.tripod.com/fontboard/arabic.html

Submitted by msameer on Thu, 13/12/2007 - 3:30pm

Why do we need that ?

Submitted by Anonymous (not verified) on Thu, 20/12/2007 - 10:53pm

I downloaded the Arabic, thanks! However, the site that I really want to use it on has some combined charachters that are not included, what do you think the likelihood of a more advanced arabic charachter set will be released soon?


Submitted by msameer on Sat, 22/12/2007 - 12:03pm

What site are you talking about ?

Submitted by Anonymous (not verified) on Sun, 30/03/2008 - 6:31pm

Can you please create a .deb package file for OS2006 (gregale)?
I know nothing about linux and don't know what to do with your files.

Submitted by msameer on Sun, 30/03/2008 - 8:10pm

Why are you still using OS 2006 ?

Submitted by Anonymous (not verified) on Wed, 02/04/2008 - 6:43pm

I have a N770 and no 1GB RS MMC.

Submitted by Asim Manzur (not verified) on Wed, 02/04/2008 - 6:18pm


Is there any way that I can request a full working Quran app, once we have the Arabic font in there? I really don't need too many functionality but atleast something which can allow me to read/recite the Quran from N800.

I tried to port Zekr in OS2008 and had no luck in the past, also looked everywhere to find the same and had no luck at all.


Submitted by msameer on Thu, 03/04/2008 - 12:41am

Zekr needs java which is not available.

Why don't you code one ? I don't think I'll do that.

Submitted by beer tables (not verified) on Thu, 03/04/2008 - 1:40pm

Thanks to your excellent help, I got hebrew input working on scratchbox and also on the N800 under OS2008 beta. I can upload the keys.xml file (svn commit perhaps) if you want to include it, for the moment heres a screenshot from the N800:

Add new comment

Subscribe to /  digg  bookmark