Zenwalk Linux

Ever tried Zen computing?

Japanese Language Input under Zenwalk

 

From Zenwalk Wiki

Jump to: navigation, search


This article is part of the Zenwalk HOWTO.
Installing/Setting Up | Internationalisation | Networks | Software | Package Management | Misc


For current Zenwalk I have provided a set of 3 packages available in the extra repo to get full japanese language reading/writing support:

  • Just do a
netpkg anthy uim sazanami

This will install all you need to get japanese language input working in Zenwalk.


For those who still use an older Zenwalk version (prior 4.6.1) or simply prefer to build from source, the following howto describes how I set up things to get japanese input working:


Before you start please make sure you have UTF-8 locales enabled for your current language. You can set this by editing /etc/profile.d/lang.sh and set this e.g. to:

export LANG=de_DE.UTF-8


and japanese fonts (e.g. sazanami from http://sourceforge.jp/projects/efont/) uncompress the sources and become root.


  • Then first compile anthy:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
make install


  • Next compile uim using anthy:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
make install


  • Now extract the japanese fonts into your X-servers true type fonts folder (for Zenwalk 4.0/4.2 this is: /usr/share/fonts/TTF/) and rebuild fontcache:
fc-cache -f


  • And finally do a
gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules


Now the last line in /etc/gtk-2.0/gtk.immodules should read:

"/usr/lib/gtk-2.0/2.10.0/immodules/im-uim.so" 
"uim" "uim" "uim" "/usr/share/locale" "ja:ko:zh:*" 


  • Logout from you current X session and login onto X again as normal user and then press SHIFT and SPACE at the same time to toggle japanese input on/off.


If input method was set correctly, you should now be able to write in Japanese.


If not then you need to run as normal user

uim-pref-gtk


and set default IM to anthy (under global settings)


or you may create the config file manually:

touch ~/.uim
echo "(define default-im-name 'anthy) ; IM-SWITCH VALUE" > ~/.uim


Precompiled packages



I have build binary tgz-packages for Zenwalk to support Japanese language input (build-scripts are included). These packages are also available via netpkg.


Just grab the latest builds of anthy, uim and sazanami-fonts from:


transZENdental


or if the above server is not reachable you can also get the packages from:


ZenCommunity


Sources are available on the second location too.


After installing the above packages the only thing left to do is to launch uim-pref-gtk and set default kana-to-kanji-converter to anthy!


Toolbar



If you want to have a toolbar for the Input Settings you can add

/usr/bin/uim-toolbar-gtk to your autostart. (Thanks to JetBoy for this tip!)


Trouble Shooting


The above method works great for all GTK+ applications. However if you encounter problems with KDE/QT apps or some other X apps, you can try the following workaround to get Japanese input working for those apps:

Open a Terminal and type:

uim-xim -engine=anthy &
XMODIFIERS=@im=uim xterm


In this example it will start xterm with Japanese Language Input method enabled. This method works for sure in almost each case.

To make it the default for each application just create a file '~/.profile' and put in:

if [ ! -z "$DISPLAY" ]; then
   uim-xim -engine=anthy & > /dev/null 2>&1
   export XMODIFIERS=@im=uim > /dev/null 2>&1
fi

--Zenwalkuser 10:24, 22 February 2007 (UTC)

Personal tools