24.12.11

Changing text direction and GNOME

 So you are writing RTL text (Hebrew, Arabic, Farsi ..) and sometimes you tend to mix some English words in it. In Windows and QT (after enabling in qtconfig) you have to press both Ctrl and Shift keys (both left or right) if you want to change direction for a single line/paragraph/selected text.

In GNOME you have the fabulous Auto Detection - the direction of your paragraph is set by the first character having strong direction. That's cool and works most of the time but what are you supposed to do when it doesn't work. Have no fear - the amazing RLM and LRM characters come to the rescue. RLM and LRM possess superpowers such as strong direction, invisibility and the ability to claim you're following the standards. All you have to do to use these is simply hit the Home key then Right-click to get the context menu then select "Insert unicode control character" (or simply change your national keyboard layout standard to include RLM/LRM) then you have to pray to Alohim/Allah that you will not change your mind later on and be forced to look for it and try to delete it.

I say we can make editing bidi-text easier in GNOME by creating several text actions bound to keyboard shortcuts to handle it. Here are the few actions I had in mind:

  1. A shortcut to change current line/selected text direction, just like windows Ctrl+shift does but insert RLM/LRM when needed.
  2. A shortcut to delete all control characters in the selected text - To be used when you made a big mess in your text and you want to fix it manually all over again.
  3. A shortcut to encapsulate selected text within RLE/LRE and PDF (Pop Directional formatting).
  4. A shortcut to encapsulate selected text whithin RLO/LRO and PDF.
This will probably have to be implemented by a patch to GNOME (GtkEntry and GtkTextView) adding some signals to preform the actions and binding them to some keyboard shortcuts. I don't think there's a special low-level API that will allow implementation of such actions. But I did look for such.

I found a very limited way in which GNOME's Input Method API can provide basic line direction switcher (No. 1 in the above list) and decided, for the sake of pure experiment to try implementing it. I think it's a ugly hack but it works well and better than nothing for now... I guess. It's not perfect at all: it works only for single lines, It might delete selected text (works great when no text is selected) and it will insert two edit actions into the undo buffer so to undo a switch you will have to hit Ctrl+z twice.

The keyboard shortcut I chose for it is Ctrl+Shift+0 or Ctrl+Shift+9 which resembles the location of RLM/LRM in the new Israeli keyboard standard. Using Ctrl+Shift alone (like in QT and Windows did) is no good because I fear it might be used for layout group selection in some layouts.

The Debian packaging and some of the code is base on the awesome Debian package for gtk-im-libthai so I was able to code and package it in a very short time, relativly... for a project with no real future.


So far I tried it only on Ubuntu 11.10+GNOME3+i368/amd64. Seems to work:

If you would like to try it, it's available in my Ubuntu PPA, package name: gtk3-im-rtl (not 'gtk-im-rtl' which is for GNOME2 and seems to be broken). currently compiled only for Ubuntu Oneiric 11.10 . You may also try to download the source and compile for other distros.
But don't you come crying to me if it broke your desktop.
The Input Method is supposed to become default after installation. If not, you'll have to set it by yourself (right click->select input method).

Happy Hackinukkah!!!
.. and merry christmas!


23.8.10

Quitting Ubuntu Hebrew Translators team

Seems that Ubuntu Hebrew Translation Administrators feel harshly about my membership in Ubuntu translators regarding my expressed opinion in a debate regarding gender in translation. In a private mail they "agreed" to renew my membership in Ubuntu Translators team "although I am a trouble maker" as they put it. Well, I didn't mean to become a trouble maker - I just wanted to talk about a technological solution to a certain problem.

I think this is no way to treat volunteers so I told YaronSh "Lech techapes et hachaverim shelcha" and quit the team. I will continue my activity in solving RTL bugs in Ubuntu.

Hebrew translation work is not fun for me anyway now that it sounds so bad.

3.5.10

It's feels good

It feels good to see a bug you fixed get mentioned in a review (original in Hebrew) on a big news site.

.... OTOH it doesn't feel so good when you see the one bug that slipped away get mentioned as well as the only thing stopping the Hebrew installation from being perfect.

Please vote for this bug by clicking "This bug affects me".
(I think it required a Launchpad account)

Maybe we'll manage to get it right for the 10.04.1 release.

29.4.10

Why desktop Linux still sucks - important to watch

I first encountered this video on Linmagazine(Hebrew):



Sometimes, we Linux enthusiasts lack the ability of self-observation. We live in our utopia thinking everything is OK and that soon everybody will use Linux on their desktops. Well, it's freakin 2010 and we're still waiting...

If we want the change to come we must keep these flaws in mind and try to resolve them one by one.

If you fix it they will come...

26.11.09

The kind of stuff that make a geek ROFLOL

What is it? Oh, it's the simple things in life like ... writing a multi-threaded quick-sort implementation in Google's new GO! programming language ....
Amazingly, it even works. Ahhh .. Oh well , had too much fun , time to sleep now.

good night.

1.7.09

Please! No politics on planet FOSS-IL!!!

If, like myself, you are tired of political posts on the FOSS-IL planet, copy the following banner and post it in your blog:

Graphics by Gimp, Tuxpaint, Culmus-fancy fonts, AP online lectures and .. Bibi :)

21.5.09

Ubuntu stability and UHR

I have been planning to port the Ubuntu Hebrew Remix remastering scripts to 9.04 for a long while now and I even started some related tasks but it seems to me more and more like this is not the right time. Ubuntu 9.04 is a shameful mess - with intel/nvidia, sound and other hardware devices having severe issues which, no doubt, will scare off new users and already made some Ubuntu users switch distributions.

Someone in Linux-IL mailing list said that Ubuntu just had bad timing(luck?) in releasing just before a few major software releases (XOrg1.6, OOo3.1, Pulsaudio(?) and new intel driver infrastructure).

I'll continue the porting effort (just to have easier job in October) and release the scripts with no ISO images. UHR will have to wait for 9.10 (hopefully 9.10 will be better). Users who need UHR for their grandmother/kids will have to manage with 8.04LTS for now.

A thought that comes to my mind: Maybe UHR should be based only on LTS releases. UHR doesn't seem to be a "big hit", but I received several thank-you notes which means it was useful to people other than me.