scim-hangul: Add im-switch support

Bug #33763 reported by Ming Hua
6
Affects Status Importance Assigned to Milestone
scim-hangul (Ubuntu)
Fix Released
Wishlist
Ming Hua

Bug Description

I've written a patch about im-switch support (to ko_KR* locale) for scim-hangul pacakge. It has two options - GTK/Qt IM module provided by SCIM platform, or the good old XIM. I believe I've done enough testing, but I would prefer to have some Korean speaking users to test this first before uploading.

Revision history for this message
Ming Hua (minghua) wrote : debdiff for adding im-switch support to scim-hangul

The debdiff from scim-hangul 0.2.1-1 to 0.2.1-1ubuntu1, adding im-switch support.

Changed in scim-hangul:
assignee: nobody → minghua
Revision history for this message
atie (atie-at-matrix) wrote :
Download full text (3.2 KiB)

I made scim-hangul 0.2.1-1ubuntu1 deb with the patches above and installed it.
But, it doesn't update /etc/alternatives/xinput-ko_KR with scim if I already have nabi installed, got to remove nabi then it's fine as below.

atie@matrix:~/download/mypackage/scim-test$ sudo dpkg -i scim*.deb
Password:
(Reading database ... 216394 files and directories currently installed.)
Preparing to replace scim-hangul 0.2.1-1ubuntu1 (using scim-hangul_0.2.1-1ubuntu1_i386.deb) ...
Unpacking replacement scim-hangul ...
Setting up scim-hangul (0.2.1-1ubuntu1) ...

atie@matrix:~/download/mypackage/scim-test$ dpkg -L scim-hangul
/.
/usr
/usr/lib
/usr/lib/scim-1.0
/usr/lib/scim-1.0/1.4.0
/usr/lib/scim-1.0/1.4.0/IMEngine
/usr/lib/scim-1.0/1.4.0/IMEngine/hangul.so
/usr/lib/scim-1.0/1.4.0/SetupUI
/usr/lib/scim-1.0/1.4.0/SetupUI/hangul-imengine-setup.so
/usr/share
/usr/share/locale
/usr/share/locale/de
/usr/share/locale/de/LC_MESSAGES
/usr/share/locale/de/LC_MESSAGES/scim-hangul.mo
/usr/share/locale/fr
/usr/share/locale/fr/LC_MESSAGES
/usr/share/locale/fr/LC_MESSAGES/scim-hangul.mo
/usr/share/locale/ja
/usr/share/locale/ja/LC_MESSAGES
/usr/share/locale/ja/LC_MESSAGES/scim-hangul.mo
/usr/share/locale/ko
/usr/share/locale/ko/LC_MESSAGES
/usr/share/locale/ko/LC_MESSAGES/scim-hangul.mo
/usr/share/locale/zh_CN
/usr/share/locale/zh_CN/LC_MESSAGES
/usr/share/locale/zh_CN/LC_MESSAGES/scim-hangul.mo
/usr/share/scim
/usr/share/scim/icons
/usr/share/scim/icons/scim-hangul.png
/usr/share/doc
/usr/share/doc/scim-hangul
/usr/share/doc/scim-hangul/changelog.gz
/usr/share/doc/scim-hangul/NEWS.gz
/usr/share/doc/scim-hangul/README
/usr/share/doc/scim-hangul/TODO.Debian
/usr/share/doc/scim-hangul/copyright
/usr/share/doc/scim-hangul/changelog.Debian.gz
/etc
/etc/X11
/etc/X11/xinit
/etc/X11/xinit/xinput.d
/etc/X11/xinit/xinput.d/scim-hangul_xim
/etc/X11/xinit/xinput.d/scim-hangul_scim
atie@matrix:~/download/mypackage/scim-test$ ls -l /etc/X11/xinit/xinput.d
total 20
lrwxrwxrwx 1 root root 30 2006-02-04 09:32 ja_JP -> /etc/alternatives/xinput-ja_JP
lrwxrwxrwx 1 root root 30 2005-12-29 11:39 ko_KR -> /etc/alternatives/xinput-ko_KR
-rw-r--r-- 1 root root 65 2006-01-23 10:25 nabi
-rw-r--r-- 1 root root 52 2005-10-27 21:49 none
-rw-r--r-- 1 root root 117 2006-02-02 10:55 scim
-rw-r--r-- 1 root root 437 2006-03-05 04:26 scim-hangul_scim
-rw-r--r-- 1 root root 361 2006-03-05 04:26 scim-hangul_xim
atie@matrix:~/download/mypackage/scim-test$ ls -l /etc/alternatives/xinput-ko_KR
lrwxrwxrwx 1 root root 28 2006-03-05 04:58 /etc/alternatives/xinput-ko_KR -> /etc/X11/xinit/xinput.d/nabi
atie@matrix:~/download/mypackage/scim-test$ sudo apt-get remove --purge nabi
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  nabi*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 1032kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 216393 files and directories currently installed.)
Removing nabi ...
Purging configuration files for nabi ...
atie@matrix:~/download/mypackage/scim-test$ ls -l /etc/alternatives/xinput-ko_KR
lrwxrwxrwx 1 root root 40 2006-03-05 05:12 /etc...

Read more...

Revision history for this message
Ming Hua (minghua) wrote : Re: [Bug 33763] scim-hangul: Add im-switch support

On Sun, Mar 05, 2006 at 11:22:36AM -0000, atie wrote:
>
> Comment:
> I made scim-hangul 0.2.1-1ubuntu1 deb with the patches above and
> installed it. But, it doesn't update /etc/alternatives/xinput-ko_KR
> with scim if I already have nabi installed, got to remove nabi then
> it's fine as below.

This is normal, as both scim-hangul_scim and nabi are registered to
im-switch as priority 50. I suppose if you run the command "im-switch
-l" with nabi installed, you can see this. Just use "im-switch -s" to
set your prefered input method, you don't need to remove nabi at all.

Which input method would Korean users prefer, scim or nabi? Both
package used priority 50 because that's suggested by im-switch
documentation. If most Korean users would prefer scim, I'll bump
scim-hangul_scim to priority 60. If most Korean users would prefer
nabi, I can lower scim-hangul_scim to priority 45.

Ming
2006.03.05

Revision history for this message
Ming Hua (minghua) wrote :

I also realized I made a mistake with the postrm script. I can't just remove the /var/lib/dpkg/alternatives/xinput-ko_KR file unconditionally, as other input methods may be still using it. I need to either write a better test in postrm, or drop postrm completely and live with a little cruft after purging scim-hangul.

Revision history for this message
Ming Hua (minghua) wrote :

On Sun, Mar 05, 2006 at 11:42:06AM -0000, Ming Hua wrote:
>
> If most Korean users would prefer scim, I'll bump scim-hangul_scim to
> priority 60. If most Korean users would prefer nabi, I can lower
> scim-hangul_scim to priority 45.

On a second thought, the more important question is which package is
installed by default (or both?). The convention for such case is that
the package installed by default should have the lowest priority, as if
the user spent extra effort to install a package, he/she must want to
use that package as well, therefore the extra package should have hight
priority.

If both scim-hangul and nabi are installed by default for the Korean
environment, though, my previous analysis stands.

Ming
2006.03.05

Revision history for this message
ZhengPeng Hou (zhengpeng-hou) wrote :

only scim-hangul will be installed when user choose ko language support .

Revision history for this message
atie (atie-at-matrix) wrote :

As far as I know "im-switch -s" should run by user and it creates a link for IM to ~/.xinput.d/ko_KR so it's same as current situation.

It is very tough to say what is a consensus of opinion for Korean IMs. In my opinion, if priority needs to be set, scim should be default IM since it's in main now and it works for CJK. :)

FYI, one developer maintains nabi, imhangul and scim-hangul for Korean IMs so he gives us same quality though.

Revision history for this message
Ming Hua (minghua) wrote :

On Sun, Mar 05, 2006 at 12:23:53PM -0000, freeflying wrote:
>
> Comment:
> only scim-hangul will be installed when user choose ko language support.

Thanks, I'll set scim-hangul's im-switch priority lower than nabi then,
at 45 and 40 for GTK/Qt IM and XIM, respectively.

Ming
2006.03.05

Revision history for this message
Ming Hua (minghua) wrote :
Download full text (3.9 KiB)

On Sun, Mar 05, 2006 at 12:27:38PM -0000, atie wrote:
>
> Comment:
> As far as I know "im-switch -s" should run by user and it creates a link
> for IM to ~/.xinput.d/ko_KR so it's same as current situation.

No, im-switch can be run by both root (to set the system configuration)
or by user (to set the user-specific configuration). It's true that it
creates a symlink in ~/.xinput.d/, but the target of the symlink can be
changed by im-switch, therefore the user can set his/her favorite input
method different than the distro/system default.

My reading of the Debian im-switch package's spec [1] tells me
"im-switch -s" is the way people are supposed to change their preferred
input method in situations like this. And I did the test myself, see
the attached log, it seems to be working very well.

I've lowered the priority to 45 and 40, and have the new debdiff ready.
Please test this new patch as well (although the change is small and I
don't expect any new problems), especially im-switch to change between
nabi and scim-hangul. If it works as expected, I'll try to get an
upload.

This priority setting is the best I know inside im-switch framework to
set two different input methods. I actually don't know what Atie's
expectation was in his original comments. Atie, do you mean an input
method should be set to default when it's installed (I doubt that's a
good idea, actually)? And of course if anyone can propose a better way
to deal with two different input methods, I'll be happen to change my
patch.

1. http://lists.debian.org/debian-devel/2005/06/msg00211.html

> It is very tough to say what is a consensus of opinion for Korean IMs.
> In my opinion, if priority needs to be set, scim should be default IM
> since it's in main now and it works for CJK. :)

No, when I was saying the popular one should have higher priority, I was
assuming both input methods would be installed by user manually. Now
that scim-hangul is installed by default, it should have a _lower_
priority, because if user does't do anything else, he/she would have
scim. If he/she spends extra efforts to install nabi when there is
already scim, we should assume he/she want to use nabi instead.
Therefore nabi will have higher priority.

> FYI, one developer maintains nabi, imhangul and scim-hangul for Korean
> IMs so he gives us same quality though.

Thanks for this info, however I believe the quality will not affect the
priority setting, new user friendliness is probably a bigger factor (new
user won't know how to set to a different IM, so the default one should
be the most friendly one to new users). But now scim-hangul is
installed by default, this is irrelevant in my opinion.

Comments?

Ming
2006.03.05

(system configuration by root)

# im-switch -z ko_KR -l
xinput-ko_KR - status is auto.
 link currently points to nabi
scim-hangul_scim - priority 45
scim-hangul_xim - priority 40
nabi - priority 50
Current `best' version is nabi.

# ls -l /etc/alternatives/xinput-ko_KR
lrwxrwxrwx 1 root root 28 2006-03-05 13:24 /etc/alternatives/xinput-ko_KR -> /etc/X11/xinit/xinput.d/nabi

# im-switch -z ko_KR -s scim-hangul_scim
Using `/etc/X11/xinit/xinput.d/scim-hangul_scim' to provide `x...

Read more...

Revision history for this message
Ming Hua (minghua) wrote : updated debdiff for scim-hangul

This patch is updated on two points:
1. Adjusted the im-switch priority to 45 and 40, as scim-hangul is installed by default.
2. Removed potentially harmful postrm. Now an useless /var/lib/dpkg/alternatives/xinput-ko_KR can be left after purging scim-hangul if the alternative was set to manual before. But this probably should be solved by update-alternatives command instead of on the level of each packages.

Revision history for this message
atie (atie-at-matrix) wrote :

I'd prefer to set 40 scim-hangul, 45 scim-hangul_xim and 50 nabi priorities. Note that scim-hangul uses scim mode, "scim-hangul_scim" gives unnecessary detail to users I think. "scim-hangul_xim" is enough to distinguish names since Korean users use scim-hangul with scim settings in most.

And, 45 and 50 prefixes for scim-hangul_xim and nabi will be OK, Korean user will use either scim-hangul with scim settings or nabi as XIM which means im-switch will be used to switch his/her IM.

Can we have a scim-hangul deb including my suggestion for adjustments into the repository soon? I asked ubuntu-ko for help, definitely need to test more cases. Mainly to check any conflictions by new scim installation if users already have their own configuration for scim, nabi or other IMs in ~/.gnomerc, Xsession.d or somewhere, secondly for skim.

Revision history for this message
atie (atie-at-matrix) wrote :

Sorry, "45 and 50 prefixes for scim-hangul_xim and nabi" meant "45 for scim-hangul_xim and 50 for nabi".

Revision history for this message
Ming Hua (minghua) wrote : Re: [Bug 33763] scim-hangul: Add im-switch support

On Mon, Mar 06, 2006 at 01:56:57AM -0000, atie wrote:
>
> Comment:
> I'd prefer to set 40 scim-hangul, 45 scim-hangul_xim and 50 nabi
> priorities. Note that scim-hangul uses scim mode, "scim-hangul_scim"
> gives unnecessary detail to users I think. "scim-hangul_xim" is enough
> to distinguish names since Korean users use scim-hangul with scim
> settings in most.

Good point on the naming. I'll change scim-hangul_scim to scim-hangul
without postfix.

> And, 45 and 50 prefixes for scim-hangul_xim and nabi will be OK, Korean
> user will use either scim-hangul with scim settings or nabi as XIM which
> means im-switch will be used to switch his/her IM.

However I don't understand this part, note when scim-hangul package is
installed, both scim-hangul (scim) and scim-hangul_xim (xim)
configurations are going to be installed. Therefore, if the Koren users
usually use SCIM mode for scim-hangul, scim-hangul should have a higher
priority than scim-hangul_xim, so that default is scim-hangul.

I won't change the priorities, but leave it as scim-hangul 45,
scim-hangul_xim 40. If I misunderstood you, please clarify.

Ming
2006.03.05

Revision history for this message
Ming Hua (minghua) wrote : updated debdiff No. 2 for scim-hangul

Changed the name of the im-switch configuration file using GTK/Qt IM module from scim-hangul_scim to scim-hangul.

Revision history for this message
atie (atie-at-matrix) wrote :

Probably I am confused priorities by thinking of prefixes in Xsession.d. I am going to make a deb with updated debfiff No.2 above. Then will test followings.

1. install scim-hangul, check im-switch list and /etc/alternatives/xinput-ko_KR
2. install nabi, check im-switch list and etc/alternatives/xinput-ko_KR
3. im-switch -s nabi
4. remove nabi, check im-switch list and etc/alternatives/xinput-ko_KR and ~/.xinput.d/ko_KR

if this test will be passed, I'll ask you for upload.

Then, will continues to test for other cases such as existing setup under Xsession.d and user configurations in home directory.

Revision history for this message
atie (atie-at-matrix) wrote :

OK, test was good. Also I've learned update-alternatives as bonus. Please upload scim-hangul_0.2.1-1ubuntu1.

One minor issue I had, I used im-switch -s nabi under my en_US locale then purged nabi.(1) I could see broken link for en_US in ~/.xinput.d so removed it by hand. (2)
After 2) I found /etc/alternatives/xinput-ko_KR broken too. I got to do
sudo update-alternatives --config xinput-ko_KR
sudo update-alternatives --auto xinput-ko_KR
for recovery.

I am wondering these two commands I use can be included into postinst later to prepare such case I had.

And, I think last patch is enough for Korean users who use ko_KR locale, but for users use other locales the patch may not work as we expect because of ko_KR specific. Need to test more.

Revision history for this message
Ming Hua (minghua) wrote : Re: [Bug 33763] scim-hangul: Add im-switch support

On Mon, Mar 06, 2006 at 09:55:19AM -0000, atie wrote:
>
> Comment:
> OK, test was good. Also I've learned update-alternatives as bonus.
> Please upload scim-hangul_0.2.1-1ubuntu1.

This is uploaded now, thanks to crimsun's kind sponsoring.

> One minor issue I had, I used im-switch -s nabi under my en_US locale
> then purged nabi.(1) I could see broken link for en_US in ~/.xinput.d
> so removed it by hand. (2)

Hmm, I didn't know im-switch can do that (setting for a locale the input
method didn't register for). But generally speaking packages are not
supposed to touch user's home directory, so not much I can do here, I'm
afraid.

> After 2) I found /etc/alternatives/xinput-ko_KR broken too. I got to do
> sudo update-alternatives --config xinput-ko_KR
> sudo update-alternatives --auto xinput-ko_KR
> for recovery.

But this is definitely something wrong. Please open a separate bug and
describe the bug in more detail, and I'll look into it.

> I am wondering these two commands I use can be included into postinst
> later to prepare such case I had.

update-alternatives is supposed to handle these situations by itself.
Let's first see what exactly the bug is.

> And, I think last patch is enough for Korean users who use ko_KR locale,
> but for users use other locales the patch may not work as we expect
> because of ko_KR specific. Need to test more.

im-switch by design is connected tightly with locale. For each new
locale you need to register a new set of alternatives. This is the
biggest reason I don't like im-switch. And now since scim-hangul is
installed by Korean language pack, I think this setting makes sense. I
can't think of any good way to get scim autostarted (unless you assume
everybody is using UTF-8 locale), if anybody has a good idea, please
propose it.

Ming
2006.03.06

Revision history for this message
Ming Hua (minghua) wrote :

On Mon, Mar 06, 2006 at 10:40:21PM -0600, minghua wrote:
>
> I can't think of any good way to get scim autostarted (unless you
> assume everybody is using UTF-8 locale),

I mean I can't think of any good way to get scim autostarted *for all
locales*, of course.

Ming
2006.03.06

Revision history for this message
Ming Hua (minghua) wrote :

built on all arches and in archive now

Changed in scim-hangul:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.