[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] discussion: new features in E. try 2.



Hi all devs,

I just repost my previous mail, since I did not get any comments on it yet :(


I would like to start a new discussion regarding E features.

During the past time I usually use 2 different languages for input in
my work.  This languages are  english and russian. So, in order to be
able to switch between them I use setxkbmap program of the X11. I wrote
a script which does language switching for me. This scrip, actually,
looks as follows:

#!/bin/sh

f=`setxkbmap -print | grep xkb_symbols | awk '{printf $4}' | cut -d '+' -f 2`

if [ $f = "us" ]; then
 setxkbmap -model compaqik13 -layout ru -variant basic
elif [ $f = "us(basic)" ]; then
 setxkbmap -model compaqik13 -layout ru -variant basic
elif [ $f = "ru(basic)" ]; then
 setxkbmap -model compaqik13 -layout us -variant basic
fi

However, it is not comfortable enought. First of all, I do not have
any visual representation of my current language selection. Second,
such a way of switching language is global. So, if I turn, for example,
russian language, I will have it everywhere and in every application I
currently use, but it would be nice to have some local language selection
per application. Finally, I already had some troubles with non-english :)
language and desktop locking. If I turn, for example, russian language
and then lock the screen from the menu, or by using shortcut, for
example ctrl+F12, I'm not able to unlock my desktop, since the ASCII
code values of russian letters are greater that 128 and E, basically,
do not accept them. Please do not refere to locale settings in this
situation :) since I prefer to work in C locale or en_US.

I would like to propose to implement such a language switchin mechanism
in E, which is similar to the script I use. Also, such a technich is
used in KDE for example. However, I'm able to implement it of course
:), but I'd like to hear different opinions on that. Moreover, I'd
like to hear some comments from devs, what should be done.

The things I want to do are the following:

a) implement a new configuration dialog that allows to select perfered
languages, to set the default input language, and to select the language
switching policy. For example such policies can be: (i) global - the
language is selected for all applications, (ii) local - the language
is selected for the specific application or a window, (iii) maybe
something else.

b) implement 2 new actions that allows to switch between selected
languages in two ways - forward and backword. For example if I have
selected 3 languages EN-RU-IT, then I want to be able to switch
between them in the 2 following ways: (i) EN->RU->IT->EN->... (ii)
IT->RU->EN->IT... Of course here I assume that default language is EN.

c) implement an E module which will monitor the current language
selection. Moreover it would be nice if it would allow to switch languages
as well. For example if one click on it.

I think the option a) is the most easiest from the implementation point
of view.

For the option b) I think the following actions whould be taken. The
main E config should store the information what langs are selected,
which is default one, and what lang switching policy is used. Also,
the current language selection should be stored in main config, probably
just temporarly, if the global language switching policy is used.

Also, I think, that the data structure representing the window border
should have a field that will show the current language selection for
this particular window, if the local language policy is selected. Then,
the language for this window should be switched automatically, when it
gets the focus.

I think, that some sort of IPC also should be implemented in order to
have a possibility to assign shortcuts. Of course, default shortcuts
should be defined as well ::))

The option c) is the most mistirious for me, since I never worked with
modules. I guess, that in order to monitor the current lang selection,
some IPC actions should exist. Also, I think, they should exist if we
want module to be able to switch languages. It would be nice if somebody
referenced me to an existing example, or briefly explain how things
should be done.


Well, I think thats all what I wanted to write and ask opinions about.
:) Waiting for comments, suggestions and etc.

sn