View previous topic :: View next topic |
Author |
Message |
Sudrien Apprentice
Joined: 01 Oct 2003 Posts: 207 Location: Michigan
|
Posted: Tue Dec 02, 2003 3:55 pm Post subject: Japanese Input under GTK2 |
|
|
This thread is now depreciated (though still useable). Please look at Japanese Input (in KDE & Gnome).
Setting Up Japanese Input (in GTK2/GNOME)
A reminder: If somthing doesn't compile, Make a post in the Desktop Environments forum. (PM me too, just do not post it in this thread)
Why? If you are reading this, I'm sure you have your own reasons. The objective of this thread is to set up your computer with japanese input without changing its default language.
There are essentially two levels needed for full japanese input from a keyboard with only Latin letters available; A program to interpret romanji into kana, and a dictionary to interpret kana to the many possibilities of kanji.
The Dictionary
There are several japanese dictionaries available in the portage tree, including canna, freewnn, anthy, and skk.
Anthy does not need an init script, being a library, and has become popular in new installations.
In your /etc/make.conf, add the following to your USE flags;
The first two tags have to do with proper international support ( A side effect of this is that your next 'emerge world' will also contain several Asian fonts ). The third is required for the kana/kanji interpreter.
Time to compile
The Interpreter
Im-ja (http://im-ja.sourceforge.net/) is a japanese interpreter for GTK2, and outlined in this document. You may also want to try out uim, which has support for multiple inputs.
Setting up the console is outlined in subsequent posts.
You should have at least im-ja-1.2-r1, otherwise you will run into some interesting bugs in Nautilus and/or gcc-3.4.
Time to test it out. Gedit is a good place. When you right-click in the main editing area, Japanese should show up in the Input Methods submenu.
Around now you should get a prompt asking if you would like to configure im-ja. Say yes, and look around. This is im-ja-conf, available from the prompt. Confirm that im-ja is using anthy, or whatever dictionary you chose.
If not, you will notice that you are still typing in your default language - this is normal. Im-ja has configurable key bindings - run im-ja-conf to see what all the defaults all are, also available in the Gnome control panel.
However, the keys you need to get started are:
The F5 key - switch between the different input modes, which include hiragana, katakana, and a mini kanjipad interface (use that mouse ).
The spacebar - once in the correct mode (usually hiragana), you can type in romanji and get hiragana characters. You will notice that these are underlined at first. Pressing the spacebar at this point will take you through a list of possible kanji in the canna dictionary.
Now if you want to set im-ja as your default input (rather than switching to it whenever you want it), put the following somwhere in your startup scripts ( I prefer it in my ~/.bashrc )
Code: |
export GTK_IM_MODULE="im-ja"
|
Other cool programs
Gjiten is a gtk-based japanese dictionary program. It takes a little bit of manual setup, outlined in the docs.
Gimp 2.0, being based off of gtk+-2, supports im-ja input.
gucharmap allows for unicode lookup of kanji.
some fonts you might be interested in;
kochi-substitute -the standard fonts, you will want them.
mikachan-font -a cool informal font
Errors
"Numbers in boxes", from (https://forums.gentoo.org/viewtopic.php?t=72008)
Try re-emerging fontconfig.
"im-ja dissapears when upgrading to gtk 2.4"
im-ja needs to be rebuilt for the new version of gtk, an probably a few other programs.
emerge -C im-ja
... and check the output for folders that are specific to gtk2.2. Anything in these folders will need to be re-emerged; for example, gucharmap.
To Do
Oo.org add fonts, xim method.
Changelog
2 Dec. 2003 - Original draft
3 Dec. 2003 - Beautification and Links
5 Dec. 2003 - .bashrc addition
6 Apr. 2004 - some clarification/updating
14 Jun. 2004 - a little clarification for anthy, im-ja-conf, gtk upgrade.
13 Jul. 2004 - change recomendation from Canna to anthy
26 Nov. 2004 - clarifacations pending kde/qt howto
20041209 - Line to KDE Howto.
20050113 - note that thread is depreciated.
Last edited by Sudrien on Thu Jan 13, 2005 6:30 pm; edited 16 times in total |
|
Back to top |
|
|
zhenlin Veteran
Joined: 09 Nov 2002 Posts: 1361
|
Posted: Wed Dec 03, 2003 9:45 am Post subject: |
|
|
You'll need all sorts of internationalisation patches for multibyte to work nicely in CLI, mostly due to legacy code. All GTK+2 apps ought to have excellent multibyte support.
That said, im-ja is the only Japanese IME I've seen so far that integrates with GTK+2. Most other IMEs can be used with other programs through XIM, which is horrible to work with. (You can only select the IME before the program starts via environment variables, and not after) |
|
Back to top |
|
|
IntergalacticWalrus Guru
Joined: 07 Jan 2003 Posts: 513 Location: Montreal QC (Canada)
|
Posted: Thu Dec 04, 2003 8:16 pm Post subject: |
|
|
Anything similar for KDE/Qt? |
|
Back to top |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
Posted: Fri Dec 05, 2003 4:22 pm Post subject: |
|
|
Sure. There's im-ja for non-GTK applications... Ok, it's supposed to be going into 0.9, is still beta, but already usable with a few applications I've tested. Couldn't get it to work with OOo yet, but that's entirely my own fault.
Thanks for this short tutorial, Sudrien! For KDE, have a look at Jason Katz-Brown's page, he explains setting up kinput2 for applications in KDE, and he's also the author of KDE's gjiten equivalent, kiten. |
|
Back to top |
|
|
IntergalacticWalrus Guru
Joined: 07 Jan 2003 Posts: 513 Location: Montreal QC (Canada)
|
Posted: Fri Dec 05, 2003 4:57 pm Post subject: |
|
|
plate wrote: | Sure. There's im-ja for non-GTK applications... :mrgreen: Ok, it's supposed to be going into 0.9, is still beta, but already usable with a few applications I've tested. Couldn't get it to work with OOo yet, but that's entirely my own fault.
Thanks for this short tutorial, Sudrien! For KDE, have a look at Jason Katz-Brown's page, he explains setting up kinput2 for applications in KDE, and he's also the author of KDE's gjiten equivalent, kiten. |
The problem with kipnut2 is that you have to configure your language environment vars to Japanese. That's so fucking annoying. All I want is type Japanese, not screw up my language vars. |
|
Back to top |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
Posted: Fri Dec 05, 2003 5:33 pm Post subject: |
|
|
I'm not a big kinput2 defender myself (hate it...), but you don't need to have sexual intercourse with your language variables in order to make it work. Check fellow Forum veteran Scottro's page for his wrapper script around applications you want to start with kinput2. I find it rather acceptable (certainly not fucking annoying as you so eloquently put it) to create this:
Code: | XMODIFIERS="@im=kinput2" LANGUAGE=en_US LC_CTYPE=ja_JP ${1+"$@"} & |
in, say, /usr/bin as something.sh, and start applications with Code: | something.sh <application> | . It's what I've been doing before im-ja came along. |
|
Back to top |
|
|
rounin Tux's lil' helper
Joined: 13 Apr 2003 Posts: 84
|
Posted: Mon Dec 08, 2003 2:01 pm Post subject: |
|
|
I'm experimenting with uim myself, but I have a feeling it uses Canna, and the only thing that works on my system is Wnn... Canna frequently reports that it can't mount any of the dictionaries....
So for the time being, it's kinput2/im-ja for me as well. Though I reckon it might be im-ja/uin in the future.
Also, check out my howto: http://home.no.net/david/i18n.html - I'd welcome some feedback on it, too. |
|
Back to top |
|
|
CitoJam n00b
Joined: 31 Jan 2004 Posts: 10 Location: Spain
|
Posted: Sat Jan 31, 2004 11:59 am Post subject: Japanese keyboard |
|
|
I am studying in Japan and I bought a Japanes laptop. Laptops here are provided with Windows and all they have a native program that works like canna and im-ja; the diference is that the Japanese keyboard has two keys that interact directly with this program to enable and disable the Japanese input, like im-ja does with F5.
My question is, can I make im-ja uses these keys instead F5? Does anybody know anything about that? _________________ "Elegance is not a dispensable luxury, but a factor that decides between succes and failure", EWD 1284 |
|
Back to top |
|
|
rounin Tux's lil' helper
Joined: 13 Apr 2003 Posts: 84
|
Posted: Sat Jan 31, 2004 12:49 pm Post subject: |
|
|
I think you can, yeah. There's a program called im-ja-conf or something like that, and that program does exactly that. The keys have special names. |
|
Back to top |
|
|
Shiryou Tux's lil' helper
Joined: 23 Jan 2004 Posts: 131 Location: United Kingdom
|
Posted: Thu Mar 04, 2004 5:20 pm Post subject: |
|
|
So far Kinput2 is more of a hindrance than a help. It seems to mess up all my Java settings. Java keeps giving kanji error messages. No this wouldnt be so bad, but netbeans cant render the text so all you get is a bunch of blocks. im-ja for kde would be pretty darn good though. Still, Gnome 2.6 might have everything i require so.... who knows |
|
Back to top |
|
|
rounin Tux's lil' helper
Joined: 13 Apr 2003 Posts: 84
|
Posted: Thu Mar 04, 2004 5:22 pm Post subject: |
|
|
Dude, forget kinput2.
Try uim-anthy (with uim-xim for XIM support), or im-ja with Canna, and im-ja-xim for XIM. |
|
Back to top |
|
|
Shiryou Tux's lil' helper
Joined: 23 Jan 2004 Posts: 131 Location: United Kingdom
|
Posted: Thu Mar 04, 2004 5:41 pm Post subject: |
|
|
yeah im-ja does rock my world, but only for GTK? Im suprised at KDE as they have had quite good international support APART from the IME. Strange... |
|
Back to top |
|
|
rounin Tux's lil' helper
Joined: 13 Apr 2003 Posts: 84
|
Posted: Thu Mar 04, 2004 6:30 pm Post subject: |
|
|
Yeah. I think Trolltech will try to implement input methods in Qt pretty soon.
As for im-ja, though, it supports XIM these days, and so does uim. You should see if there are any instructions on im-ja's site for using it with XIM. |
|
Back to top |
|
|
Sudrien Apprentice
Joined: 01 Oct 2003 Posts: 207 Location: Michigan
|
|
Back to top |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
|
Back to top |
|
|
Shiryou Tux's lil' helper
Joined: 23 Jan 2004 Posts: 131 Location: United Kingdom
|
Posted: Fri Mar 05, 2004 2:02 pm Post subject: |
|
|
Ah cool. Somewhere in there, there has to be a better input method than Kinput2. For some reason ja_JP.UTF-8 doesnt work for me... plus the problems i mentioned before are still there. THis XIM business? It seems like jsut an add-on to Kinput2 from what i can gather. I'll check out these sites and see what i can find. Cheers again
Yeah, from what i can gather.... Kinput2 is the only way to do Japanese entry in KDE. Darn shame is that. Guess its a switch to Gnome |
|
Back to top |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
Posted: Fri Mar 05, 2004 5:02 pm Post subject: |
|
|
Whoa! Hold your horses. XIM is just an API, the "X Input Method", and as such is probably not to blame for any shortcomings in kinput2, im-ja-xim, nicolatter, jmode, ATOK-X, XCin/Chinput/SCIM (for Chinese) or ami (Korean). They're all just protocol servers that use the same API to bring their output to the screen (and into XIM-aware applications), but what happens beneath has nothing to do with XIM itself. For all I know you could even use the Windows IME in Wine and pass it on to applications via XIM (works with Chinese, by the way)...
What im-ja and uim do differently is using Gtk+'s immodule to access applications, instead of going through an XIM server. I'd expect Qt to come up with a similar non-XIM solution some day, too, but until then, there's already quite a number of alternatives in KDE. Try Nicolatter or skkinput, maybe you like those better. And Atok-X has a very good reputation, but it's not exactly cheap, and I've never actually heard of anyone using it in Gentoo. |
|
Back to top |
|
|
Sudrien Apprentice
Joined: 01 Oct 2003 Posts: 207 Location: Michigan
|
Posted: Tue Mar 09, 2004 2:48 pm Post subject: |
|
|
Bah. 803 views at this point, and no mention in GWN.
(http://www.gentoo.org/news/en/gwn/20040308-newsletter.xml)
>_<
It's obvious (to me) why im-ja is not included at http://king.gentoo.gr.jp/pukiwiki/ at this point - im-ja is not made by a native japanese speaker, and is not for native japanese speakers.
I am pretty sure of this.
The English-only documentation is a big giveaway. And it is great for me, being that I can not yet read much Japanese.
---
In other news, I am not getting the XIM method to actually work under openoffice-bin - I can switch modes, but text never actually appears. Has anyone got this to work?
-Sud. _________________ ... |
|
Back to top |
|
|
rounin Tux's lil' helper
Joined: 13 Apr 2003 Posts: 84
|
Posted: Tue Mar 09, 2004 5:01 pm Post subject: |
|
|
As far as I know, there are native Japanese speakers using im-ja. Of course the documentation is always an issue, but the general idea is that im-ja, uim-anthy, kinput2-wnn, kinput2-canna, and a lot of other methods actually all work in the same way.
The reason you're having problems with OpenOffice is probably because you're using a version without compiled-in Unicode support, though it's hard to tell for sure.
There might be an input module system for Qt in the works, though, so you might be able to use those with the Qt version of OpenOffice then. |
|
Back to top |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
Posted: Tue Mar 09, 2004 11:27 pm Post subject: |
|
|
Could be a font issue in Openoffice, too. You may have to add the Japanese fonts manually to the path Openoffice looks at. A short howto on adding fonts to Openoffice is at this OOo page. |
|
Back to top |
|
|
Sudrien Apprentice
Joined: 01 Oct 2003 Posts: 207 Location: Michigan
|
Posted: Tue Apr 06, 2004 5:21 pm Post subject: |
|
|
Me no speak java
---
im-ja 1.0 has been in portage for a little bit. Haven't been able to really test it out yet due to xserver/radeonfb/opengl experiments.
-Sud. _________________ ... |
|
Back to top |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
Posted: Wed Apr 07, 2004 9:06 am Post subject: |
|
|
1.0-r2 is doing ok since Mamoru fixed a glitch. Interestingly enough, --enable-xim was synonym to --disable-xim... I've had smallish problems with Openoffice and im-ja 1.0, but they appear to be solved since this morning upon upgrading to OOo 1.1.1.
Coming to think of it: Would any of you people be interested in contributing to a write-up for Japanese input methods in the same style as liquidx did for Chinese? Sudrien's initial post here could be used as an im-ja entry, and then we'd have to include all the other methods in one single place, each described preferrably by someone who uses them...
By the way, is anyone here knowledgeable about this IIIMF method that's been lingering in Portage since September already? Looks like it's the future for Japanese input, across platforms, too, and there's even a subproject dealing with the Qt solution some of us have been looking for (but unfortunately it's not anywhere near Portage yet). Anyone running one of the available IIIMF methods, care to share your experience? |
|
Back to top |
|
|
puntium n00b
Joined: 14 Mar 2003 Posts: 24
|
Posted: Sun Apr 11, 2004 3:53 am Post subject: |
|
|
I had some form of a writeup somewhere, but it is horribly out of date.
http://www.cs.ubc.ca/~kdeeter/gentoo-jap-guide/index.html
Feel free to use it as a basis for something though.
Before gentoo was around, japanese input meant kinput2 + canna or wnn, or skk, but now you have many many choices. (Uim, iiimf, xim, skk, im-ja, atokx, wnn7, vje, etc etc)
As for Qt, there is an immodule for qt project in the works. Actually, a first version patch is already done, but there is some issues with getting Trolltech to work it in. It breaks binary compatibility so it probably won't be around until Qt4 anyhow.
As for im-ja, there are Japanese users using this.. the reason the docs are in english is because I think it has been developped by gtk2-related english-speaking developers interested in japanese (might be wrong, thats just the sense i got) But it's gtk2-only-ness makes reduces the incentive to switch to it when you are already used to kinput2+canna or whatever.
As for atok-x, there is an ebuild for it available
http://king.gentoo.gr.jp/pukiwiki/pukiwiki.php?%5B%5Batokx%5D%5D
please use the 1.0-r2 version, as it works the best. |
|
Back to top |
|
|
osugi_sakae n00b
Joined: 24 Oct 2002 Posts: 28 Location: Columbus, OH
|
Posted: Mon May 10, 2004 12:41 am Post subject: |
|
|
Here is a fairly simply solution if you are like me and do not need to do a lot of Japanese input.
Rather than deal with setting up freewnn or canna (etc.), I use emacs to type Japanese and then either copy and paste it (middle button works best) or save it to a file and open the file in OOo or whichever program. (When saving to a file, tell emacs to save as euc-jp with C-x RET f and type euc-jp-unix.)
Works great as long as you have your environment set up properly. I have a file 80i18n in /etc/env.d/ (think I copied it from an old Mandrake install - don't know if the name is standard or not). Looks like this:
LC_MONETARY=en_US
LC_COLLATE=en_US
LC_NUMERIC=en_US
LC_TIME=en_US
LANG=en_US
LC_MESSAGES=en_US
LC_CTYPE=ja_JP
LANGUAGE=C
LANG=ja_JP
XIM=kinput2
XIM_PROGRAM=kinput2
XMODIFIERS="@im=kinput2"
without this, Japanese text turns to gibberish if you paste it outside of emacs. with it, text copy just fine.
there is a small downside - euc-jp seems to become the default encoding for saving all files. but that isn't a big deal since I think the English parts of euc-jp are identical to ascii.
hope this helps. _________________ I am not a number, I am a free man.
---- The Prisoner |
|
Back to top |
|
|
Sudrien Apprentice
Joined: 01 Oct 2003 Posts: 207 Location: Michigan
|
Posted: Mon Jun 14, 2004 8:02 pm Post subject: |
|
|
An update or two...
Gjiten 2.2, with gtk2.4 support, has just been released. Made a note about re-emerging stuff for upgrading gtk.
Taka (http://taka.sourceforge.net/) is an open-source stroke order database for learners. Anybody willing to add to or correct entries in their database would be welcomed.
Taka is already integrated into PAdict CVS, test binaries available. (http://padict.sourceforge.net/).
-Sud. _________________ ... |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|