Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Debian GNU/Linux Reference Guide
Prev Home Next

9.7.9 Example for a multilingual X window system

Let us set up a multilingual X window system which simultaneously supports Japanese, English, German, and French with EUC, UTF-8, and ISO-8859-1 encodings in different consoles.

I will show you a customization using the Debian menu system. See the details of Debian menu system in /usr/share/doc/menu/html/index.html. I also create a shortcut to the mozilla web browser in this example. [ 46]

  • install Kana-to-Kanji conversion system and dictionary (for Japanese):

    • canna – Local server ("free-beer" license), or

    • freewnn-jserver – Network-extensible server (Public Domain)

  • install Japanese input method system (for Japanese):

    • kinput2-canna – for X, or

    • kinput2-canna-wnn – for X, and

    • egg – directly works with Emacsen even in console (optional)

  • Install compatible terminals (for all):

    • xterm – X (for ISO-8859-1 and UTF-8),

    • kterm – X (for Japanese EUC), and

    • mlterm – X (multilingual).

  • add all the required font packages. (for all)

  • create the ~/.xsession that sets the user-specific X environment as described in Custom X sessions, Section 9.4.5.1 (for all):

         #!/bin/sh
         # This makes X work when I su to root.
         if [ -z "$XAUTHORITY" ]; then
                 XAUTHORITY=$HOME/.Xauthority
                 export XAUTHORITY
         fi
         
         # Set specific environment through debian menu system.
         # Reset locale
         unset LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
         unset LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
         unset LC_IDENTIFICATION LC_ALL LANG LANGUAGE PAGER
         # set locale default in X
         LANG=C
         # export locale
         export LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
         export LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
         export LC_IDENTIFICATION LC_ALL LANG LANGUAGE PAGER
         ###
         # activate input method for Japanese with kinput2
         kinput2 &
         XMODIFIERS="@im=kinput2"
         export XMODIFIERS
         # How about blackbox window manager (lightweight)
         exec blackbox
         #exec xfwm
         #exec wmaker
    
  • set locale in ~/.bash_profile for Linux consoles (for all).

  • remove locale settings from ~/.bashrc, if existed (for all).

  • create few files in /etc/menu/ (for all).

    • /etc/menu/xterm-local: (add new entries to menu) [47]

           ?package(xterm):\
            needs=x11\
            section=XShells\
            longtitle="XTerm: terminal emulator (en_US.ISO-8859-1)"\
            title="XTerm (en_US.ISO-8859-1)"\
            command="sh -c 'LC_ALL=en_US.ISO-8859-1 xterm'"
           ?package(xterm):\
            needs=x11\
            section=XShells\
            longtitle="XTerm: terminal emulator (de_DE.ISO-8859-1)"\
            title="XTerm (de_DE.ISO-8859-1)"\
            command="sh -c 'LC_ALL=de_DE.ISO-8859-1 xterm -T xterm-de'"
           ?package(xterm):\
            needs=x11\
            section=XShells\
            longtitle="XTerm: terminal emulator for X with Unicode support (Japanese)"\
            title="UXTerm (ja_JP.UTF-8)"\
            command="sh -c 'LC_ALL=ja_JP.UTF-8 uxterm'"
      
    • /etc/menu/kterm: (override the system default) [48]

           ?package(kterm):\
            needs="x11"\
            section="XShells"\
            command="sh -c 'LC_ALL=ja_JP.eucJP PAGER=w3m /usr/X11R6/bin/kterm -xim'" \
            title="Kanji Terminal"
           ?package(kterm):\
            needs="x11"\
            section="XShells"\
            command="sh -c 'LANG=ja_JP.eucJP \
                     LC_MESSAGES=en_US.ISO-8859-1 PAGER=w3m /usr/X11R6/bin/kterm -xim'" \
            title="Kanji Terminal (bilingal)"
      
    • /etc/menu/mozilla-local: (add a new shortcut) [49]

           ?package(mozilla-browser):needs="x11" section="/" \
                   title=" Mozilla Navigator" command="mozilla-1.5" hints="Web browsers" \
                   icon=/usr/share/pixmaps/mozilla.xpm
      
    • run update-menus from the root account.

  • add the following lines to ~/.muttrc (for Japanese):

         # UTF-8 support is not popular in popular Japanese EMACS environment
         # 7-bit encoding of iso-2022-jp is easier for everyone.
         # default encoding order = us-ascii --> iso-8859-1 --> iso-2022-jp
         set send_charset="us-ascii:iso-8859-1:iso-2022-jp"
         set allow_8bit=no
    
  • activate XIM kinput2 for X applications (for Japanese):

    • add *inputMethod: kinput2 and KTerm*VT100*OpenIm: true to your X resources file, ~/.Xresources (it looks like Debian takes care of this automatically somehow).

    • Some applications (such as mlterm) also allow you to set up *inputMethod: and other information dynamically at runtime (press Ctrl-MouseButton-3 in mlterm).

  • start X by typing startx or from one of the display managers (xdm, gdm, kdm, wdm, ...) (for all).

  • start a Japanese-compatible application such as Vim 6, (x)emacs21, mc-4.5, mutt-1.4, ... in kterm (for Japanese). (Emacs seems to be the most popular platform, though I do not use it.)

  • press Shift+Space to toggle Japanese character input mode on and off (for Japanese).

  • read the localized manual page by starting command in localized console (for all).

For other CJK language supports, see the following sections and SuSE pages for CJK.


Debian GNU/Linux Reference Guide
Prev Home Next

 
 
  Published under the terms of the GNU General Public License Design by Interspire