Using Japanese with solaris

This page is written for those people who are interested in adding on Japanese display and/or input to their Solaris machine, if you did not install "Japanese language support" when you installed Solaris.

To put it another way, this page is of interest to non-native-Japanese-speakers, who wish to read, and possibly write, Japanese, on their Solaris machine.

Japanese Output (displaying Japanese fonts)

Normally, all you should need to do is display all the relevant fonts. For solaris 9, this means the following packages:
 # Not really required, but it is a dependancy of the fonts"
 # SUNWjxplt   Japanese X Window System platform software

 SUNWjxcft  Japanese Required TrueType Font
 SUNWjxmft  Japanese Required Bitmap Font
 SUNWjxoft  Japanese Optional TrueType Font
 SUNWjxfnt  Japanese Optional Bitmap Font
At minimum, you should install the first two, but you may as well install all four. The Optional fonts come on the "languages CD", however.

You will then want to add the involved directories to your font path. One way of doing this is:

xset fp+ /usr/openwin/lib/locale/ja/X11/fonts/TT
xset fp+ /usr/openwin/lib/locale/ja/X11/fonts/75dpi

Note to GNOME/gtk2 users: after adding in all the Japanese fonts (particularly the larger "optional" set) things may suddenly start running reeeaaaly slow for you. In which case, I recommend running "fc-cache" as root, so that it generates up-to-date font.cache info for the new font directories. If that doesnt help enough, I would then recommend removing the optional bitmap font package, SUNWjxfnt.

Japanese input (typing in Japanese)

This section enables you to type in romaji-style, have it initially display as hiragana, and then auto-converted to the appropriate kanji of your choice.

First, install all the packages mentioned in the "Japanese Output" section, above. You will then need to add the following packages:

#from the regular CDs
SUNWxim        X Window System X Input Method Server Package
SUNWjfpu       Japanese localization common usr files
#from the languages CD
SUNWjwncr     Japanese Input System - Wnn6 Client, (Root)
SUNWjwncu     Japanese Input System - Wnn6 Client, (Usr)
SUNWjwncx     Japanese Input System - Wnn6 Client X Window System
SUNWjwndt     Japanese Input System - Wnn6 Client for CDE
SUNWjwnsr     Japanese Input System - Wnn6 Server, (Root)
SUNWjwnsu     Japanese Input System - Wnn6 Server, (Usr)


######################## Optional stuff #########################
# You may also choose to install the atok input packages, instead of
# using whatever the default input method "xjsi" is:
#JSatsvr        Japanese Input System ATOK12 root files
#JSatsvu        Japanese Input System ATOK12 usr files

This gives you a word lookup server, a word lookup client, and an X input method client/server. You then have to start the various demons. First comes the word lookup server, Wnn:
# This one is normally started at login time automatically, but right now
# you'll want to start it by hand.
# This actually starts THREE demons! Sigh...

/etc/init.d/Wnn6 start
Then you need to start the X11 client interface.
LC_ALL=ja /usr/openwin/bin/htt -if xjsi -so -nosm &

# or if you want to use the optional atok packages mentioned above,
#LC_ALL=ja /usr/openwin/bin/htt -if atok12 -xim htt_xbe &

The htt flags are currently somewhat undocumented: I had to install the japanese locale fully, and log in, to find out what was required. I still dont know the meaning of xjsi, or -xim htt_xbe.

The -so option is rather useful: it allows starting "htt_props" separately, so that you can see the menus in English!. Unfortunately, I have found no method of doing the same for the Wnn control popup.

Once all this is done, you can finally input japanese chars... but usually, only in programs started with japanese mode enabled!

For example,

LC_CTYPE=ja gedit
or
LC_CTYPE=ja dtterm

There will now be an odd little display line at the bottom of the window, showing "[--]".
To switch to Japanese input mode, press [control]-[spacebar], and it will turn to a hiragana "A", indicating you are in romaji-based hiragana input mode. To switch back, press [control]-[spacebar] again.


If you want to be "old school" and give yourself a "kanji" key to trigger input, but you dont actually HAVE such a key.... you can use xmodmap to give yourself one. If you have a type6 sun keyboard, which has a "blank" key between Help and F1, , a way to do this is

xmodmap -e 'keysym F13 = Kanji'

Japanese locales (Menus in Japanese)

This is if you want to go even further, and want to be closer to having the full "Japanese language support" for all programs in Solaris. For example, if you want to actually log in as a full japanese user. The best way to do this is probably to just insert the "languages CD", and run the "installer" program on the cdrom. But if you really want to do it piecemeal, this is a list of additional packages that I believe are the minimum required set, to get something working. You really should do the full languages install for this sort of thing.

SUNWjos        Japanese ON message files

#core solaris CDs
SUNWjfpu       Japanese localization common usr files
   #SUNWjfpu was already added for the "Japanese input" section above
SUNWlcl        Locale Conversion Library
SUNWlclx       Locale Conversion Library (64-bit)

#languages CD
SUNWjfpue      Japanese localization common usr files (Extensions)
SUNWjfpux      Japanese localization common usr files (64-bit)
# For CDE, to give japanese as a language option
SUNWeudlg      UTF-8 L10N For CDE Desktop Login



Written by:Philip Brown - - - Bolthole Top Solaris Top - - - Search Bolthole.com