Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Japanese Input under GTK2
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Sudrien
Apprentice
Apprentice


Joined: 01 Oct 2003
Posts: 207
Location: Michigan

PostPosted: Tue Dec 02, 2003 3:55 pm    Post subject: Japanese Input under GTK2 Reply with quote

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;

Code:
cjk nls anthy


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.

Code:

emerge im-ja


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 (http://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
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Wed Dec 03, 2003 9:45 am    Post subject: Reply with quote

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
View user's profile Send private message
IntergalacticWalrus
Guru
Guru


Joined: 07 Jan 2003
Posts: 513
Location: Montreal QC (Canada)

PostPosted: Thu Dec 04, 2003 8:16 pm    Post subject: Reply with quote

Anything similar for KDE/Qt?
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Fri Dec 05, 2003 4:22 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
IntergalacticWalrus
Guru
Guru


Joined: 07 Jan 2003
Posts: 513
Location: Montreal QC (Canada)

PostPosted: Fri Dec 05, 2003 4:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Fri Dec 05, 2003 5:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
rounin
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2003
Posts: 84

PostPosted: Mon Dec 08, 2003 2:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
CitoJam
n00b
n00b


Joined: 31 Jan 2004
Posts: 10
Location: Spain

PostPosted: Sat Jan 31, 2004 11:59 am    Post subject: Japanese keyboard Reply with quote

I am studying in Japan and I bought a Japanes laptop. Laptops here are provided with Windows :evil: 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
View user's profile Send private message
rounin
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2003
Posts: 84

PostPosted: Sat Jan 31, 2004 12:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Shiryou
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2004
Posts: 131
Location: United Kingdom

PostPosted: Thu Mar 04, 2004 5:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
rounin
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2003
Posts: 84

PostPosted: Thu Mar 04, 2004 5:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Shiryou
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2004
Posts: 131
Location: United Kingdom

PostPosted: Thu Mar 04, 2004 5:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
rounin
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2003
Posts: 84

PostPosted: Thu Mar 04, 2004 6:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sudrien
Apprentice
Apprentice


Joined: 01 Oct 2003
Posts: 207
Location: Michigan

PostPosted: Thu Mar 04, 2004 11:56 pm    Post subject: Reply with quote

Yes, im-ja 0.9 does have that support.

Will run some tests and update things.

http://im-ja.sourceforge.net/im-ja-doc.html#xim-server



-Sud.
_________________
...
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Fri Mar 05, 2004 8:06 am    Post subject: Reply with quote

The Japanese Gentooistas have set up a Wiki where they collect installation and usage notes for the different IMEs. B0Ti's im-ja is still missing, but every other method known to penguins is listed.
Back to top
View user's profile Send private message
Shiryou
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2004
Posts: 131
Location: United Kingdom

PostPosted: Fri Mar 05, 2004 2:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Fri Mar 05, 2004 5:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sudrien
Apprentice
Apprentice


Joined: 01 Oct 2003
Posts: 207
Location: Michigan

PostPosted: Tue Mar 09, 2004 2:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
rounin
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2003
Posts: 84

PostPosted: Tue Mar 09, 2004 5:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Tue Mar 09, 2004 11:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sudrien
Apprentice
Apprentice


Joined: 01 Oct 2003
Posts: 207
Location: Michigan

PostPosted: Tue Apr 06, 2004 5:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Wed Apr 07, 2004 9:06 am    Post subject: Reply with quote

1.0-r2 is doing ok since Mamoru fixed a glitch. Interestingly enough, --enable-xim was synonym to --disable-xim... 8O 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... :P

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
View user's profile Send private message
puntium
n00b
n00b


Joined: 14 Mar 2003
Posts: 24

PostPosted: Sun Apr 11, 2004 3:53 am    Post subject: Reply with quote

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
View user's profile Send private message
osugi_sakae
n00b
n00b


Joined: 24 Oct 2002
Posts: 25
Location: Columbus, OH

PostPosted: Mon May 10, 2004 12:41 am    Post subject: Reply with quote

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
View user's profile Send private message
Sudrien
Apprentice
Apprentice


Joined: 01 Oct 2003
Posts: 207
Location: Michigan

PostPosted: Mon Jun 14, 2004 8:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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