SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2008-12-24 00:07:53

impudicus
New Member
Registered: 2008-12-23
Posts: 2

Japanese input please help

As the title sez...

I require some help getting Japanese input working in #!Crunchbang.

I have downloaded the gnome-base-ja packages from the repository. (Scim, Uim, and Anthy, et al) but cannot switch to Japanese input.
I can get Scim up and running, but Anthy just won't switch on.

I have scrutinized several tutorials online ( Ubuntu , Fedora, Debian) dealing with Japanese input in hopes that I might gleen some insight into what needs be done for any and all flavors of Linux... but I just can't figure it out.

It was a breeze under Xubuntu, but I really do not want to switch back. I really dig !#.
Please won't you lend a hand... I have to use Japanese input on a regular basis.   

Thanks for your help
Imp

Offline

Help fund CrunchBang, donate to the project!

#2 2008-12-24 01:40:29

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

It's a breeze under crunchbang too. 
Ja.....

Let me think.

aptitude install scim-anthy language-support-fonts-ja

  I don't know if my page is one of the ones you looked at  http://home.roadrunner.com/~computertai … ninpt.html

It used to be *the* page on Japanese in Linux, but nowadays, there are so many distros that I don't really maintain it, though it's listed (with an incorrect URL) in the scim-anthy README.   smile
First scim -d
(you probably already did that.)

Ok, then try something like (in any terminal)

XMODIFIERS='@im=SCIM' LC_CTYPE=en_US.UTF-8 uxterm

(That's assuming you're in the US.  LC_CTYPE should work with any language and UTF-8.)



Then hit ctl+space.  Anthy should open.  If it's not set to Japanese (there are a bunch of other languages installed), you should be able to select it.  If this works, you can make a little shell script (and add GTK_IM_MODULE which is necessary for some, though not all apps)

#!/bin/sh
XMODIFIERS='@im=SCIM' LC_CTYPE=en_US.UTF-8 GTK_IM_MODULE="scim" ${1+"$@"} &

Call it lang.sh and make it executable.

chmod 755 lang.sh

Now you should be able to run, for example

lang.sh firefox

and be able to input Japanese, assuming the application accepts it.  (For example, xterm won't accept it, uxterm will). 
You can change your rc.xml keybindings to use it--for example, if you have a <command>uxterm</command> you can change it to <command>lang.sh uxterm</command>.

Offline

#3 2008-12-24 02:57:28

impudicus
New Member
Registered: 2008-12-23
Posts: 2

Re: Japanese input please help

スコットロさんの助けには有り難う御座いました!
Thank you for your much need help.

The terminal execution worked a-o-k with calling up the uxterm with 日本語support, but not gEdit nor Firefox.
However, the sh script works a charm. Mus' be the GTK_IM_MODULE inclusion.

Thanks again
-Imp

Offline

#4 2008-12-24 03:29:56

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

My pleasure.  More correct Japanese would probably be (I'm using romaji as I don't have scim running right now)

sukotto san ni ha (ha being wa in this case) tasukete itadaite arigatou gozaimashita.  (Also gozaimasu is seldom written in kanji--mostly we foreigners do it.)  smile  (My first name is Scott, so it's actually sukotto rather than sukottro, but that's not important).

(That's rather polite, especially using itadaite, the same verb base as itadakimasu.) So, to a native Japanese, you'd probably do it that way, tasukete itadaite, and not use kanji for gozaru.  (gozaimasu).

However, as I think we're a fairly casual bunch here, and you don't know that I'm ancient in years (or didn't till just now) doing tasukete kurete (as in kurimasu, ) would be fine. 

Actually, if writing to a native Japanese, you might even make it more polite to the point of exaggeration and use

itsudemo tasukete itadaite.  smile

(I'm not sure how advanced you are in Japanese, so if this was yokei na osewa, yurushite kudasai.)

As I mention on my page, it seems to depend not only on application, but on the system.  For example, in BSD and CentOS, I need to use LC_CTYPE=ja_JP.UTF-8 for Openoffice to work.  On  Ubuntu, en_US.UTF-8 works fine with OO as long as I have the GTK_IM_MODULE.   You can also at QT_IM_MODULE for safety in case you use some KDE apps.

(Just as an additional argument in the script, on the same line as the rest of it.)

The GTK_IM_MODULE is, as you've realized, necessary for GTK apps. (Though, you can sometimes skip it if you use LC_CTYPE=ja_JP.UTF-8).  I left it out of the first set of instructions because it's not necessary for uxterm, but I should have explained it a bit better.

As I said, it can vary, not only between applications, but between distributions and O/S's (e.g., Linux and BSDs.)
Generally speaking the GTK and QT IM_MODULES and LC_CTYPE, as your native language (with UTF-8) and the XMODIFIERS should do it.

There are other GUI centric ways, which I don't use, so I'm not really sure of how they work--e.g., in Ubuntu, I think you can choose input method or something like that from a right click menu.  The way I've given you here, however, should work on all systems with any sort of window manager.

Offline

#5 2009-02-06 21:58:55

clemens
#! CrunchBanger
Registered: 2009-02-06
Posts: 133

Re: Japanese input please help

HEEEELP!!
I have followed your advice and indeed the scim control came out, but still I am not able to write in Japanese in Open office or Firefox.
What should I do??
Is there a way to have scim appear and work properly at startup without having to type commands all the time so that I can easily select the language necessary (I often use Japanese Korean and Chinese)?
Cheers

Offline

#6 2009-02-06 23:36:44

clemens
#! CrunchBanger
Registered: 2009-02-06
Posts: 133

Re: Japanese input please help

I also tried installing the light chinese input software, but I can never manage to write asian character in firefox or open office. I have all the files installed though. and even after running scim I cannot manage.

Offline

#7 2009-02-07 12:21:43

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

clemens, have you tried something like, from an xterm

XMODIFIERS='@im=SCIM' LC_CTYPE=ja_JP.UTF-8 firefox

Then hit ctl+space to bring up the Japanese input box?
OpenOffice can sometimes be tricky. Sometimes, one has to specifically add language support from the Tools=>Options menus and play around with the language options.  I'm afraid I can't be of any help with Chinese and Korean.

I believe that putting in your .bash_profile
export XMODIFIERS='@im=SCIM'
export LC_CTYPE=en_US.UTF-8
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
scim -d

might accomplish your other desire, that of having it work each time at startup.  I haven't done that in awhile though, as my need for it is relatively infrequent.

That still might not work with openoffice.  Assuming you're doing the above, and it doesn't, then I would open it from the command line with

LC_CTYPE=ja_JP.UTF-8 <whatever the latest command to open openoffice may be>
OpenOffice, depending upon version, distribution and many other things which seem to change from time to time (or more likely, I've found my quick fixes so never kept track), often seems to require setting the LC_CTYPE to ja_JP.

Offline

#8 2009-02-07 18:11:26

clemens
#! CrunchBanger
Registered: 2009-02-06
Posts: 133

Re: Japanese input please help

Thanks for your help.
I don't know why but I get a Gtk-WARNING **:locale not supported by C library, which is very strange since I have installed all the Japanese language packs. What should I do?
I know it takes time and it is complicated, but do you know if there are there plans to make language selection in cruncheee easy? This is the only thing that worries me about this distro.
Cheers

Offline

#9 2009-02-07 21:56:47

kozimodo
#! Member
From: Baltimore, MD
Registered: 2008-11-30
Posts: 70

Re: Japanese input please help

scottro wrote:

...
I believe that putting in your .bash_profile
export XMODIFIERS='@im=SCIM'
export LC_CTYPE=en_US.UTF-8
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
scim -d
...

You need to put them in .config/openbox/autostart.sh or it will only work with programs you start from a terminal window.

Offline

#10 2009-02-08 02:39:52

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

Ah thank you.  To be honest, I usually use fluxbox, so hadn't realized that.

The Locale warning sometimes has to do with using utf8 rather than UTF-8.  You might even want to do something like dpkg-reconfigure locales and make sure you have the necessary ones.  (I hope I have the command right, I'm in CentOS as I type this, so can't check.) 

Also do locale -a |grep ja_JP and see how they list it, if it's UTF-8, utf8 or whatever.  If the dpkg-reconfigure locales (locale?  Again, can't check at this instant) doesn't fix it, sometimes playing with the case and hypenation of utf-8 will fix it.

Also, it will sometimes work, even if you get that message.  (And sometimes, it won't).

Offline

#11 2009-02-09 20:50:39

clemens
#! CrunchBanger
Registered: 2009-02-06
Posts: 133

Re: Japanese input please help

Thanks,

I will try it now

Offline

#12 2009-03-11 01:53:37

kujo
New Member
Registered: 2009-03-10
Posts: 3

Re: Japanese input please help

Hi
anyone succeed to install scim ?
I tried as scottro explained, but can't get it work well. I mean I can only launch scim without Japanese input, left click does nothing. (T_T)

tasukete kudasai!! \(ç_ç)/

Offline

#13 2009-03-11 02:17:34

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

What application are you using? 

I assume scim is installed.  (and scim-anthy).

You might need a UTF-8 capable terminal. 

Would you try, after making sure the scim daemon is started (with scim -d)

XMODIFIERS='@im=SCIM' LC_CTYPE=en_US.UTF-8 uxterm

See if you are able to input Japanese in that terminal.

Offline

#14 2009-03-11 02:48:19

kujo
New Member
Registered: 2009-03-10
Posts: 3

Re: Japanese input please help

scottro wrote:

What application are you using? 

I assume scim is installed.  (and scim-anthy).

You might need a UTF-8 capable terminal. 

Would you try, after making sure the scim daemon is started (with scim -d)

XMODIFIERS='@im=SCIM' LC_CTYPE=en_US.UTF-8 uxterm

See if you are able to input Japanese in that terminal.

Hi thanks for answering Scottro
Yep it works fine in the terminal. smile)
Now i'm stuck at the firefox step, sorry i don't really get it (^_^;;
thanks for your help!

Offline

#15 2009-03-11 03:48:45

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

Sigh, I've really got to go to sleep (almost midnight here) so I hope my answer will be understandable.  smile

I think if you do, from a terminal

XMODIFIERS='@im=SCIM' LC_CTYPE=en_US.UTF-8 GTK_IM_MODULE="scim" firefox

that it will probably work. If that doesn't work, try changing en_US.UTF-8 (assuming that's your usual language, of course) to ja_JP.UTF-8

I'll give more of an explanation tomorrow (though probably not till the evening).  Just a really brief explanation---often all you need to do is set XMODIFIERS and LC_CTYPE.  I've found this to vary with distribution (and OS, e.g., the BSDs) and the application.  For example, Firefox is a GTK app so it will probably work with *either* ja_JP.UTF-8 OR GTK_IM_MODULE.  However, sometimes, it needs both.  I'm writing this from CentOS, so can't do a hands on test at this instant.

Offline

#16 2009-03-14 00:08:25

kujo
New Member
Registered: 2009-03-10
Posts: 3

Re: Japanese input please help

scottro wrote:

Sigh, I've really got to go to sleep (almost midnight here) so I hope my answer will be understandable.  smile

I think if you do, from a terminal

XMODIFIERS='@im=SCIM' LC_CTYPE=en_US.UTF-8 GTK_IM_MODULE="scim" firefox

that it will probably work. If that doesn't work, try changing en_US.UTF-8 (assuming that's your usual language, of course) to ja_JP.UTF-8

I'll give more of an explanation tomorrow (though probably not till the evening).  Just a really brief explanation---often all you need to do is set XMODIFIERS and LC_CTYPE.  I've found this to vary with distribution (and OS, e.g., the BSDs) and the application.  For example, Firefox is a GTK app so it will probably work with *either* ja_JP.UTF-8 OR GTK_IM_MODULE.  However, sometimes, it needs both.  I'm writing this from CentOS, so can't do a hands on test at this instant.

答え、ありがとうございました!!
_| ̄|●

Offline

#17 2009-03-14 00:33:36

Mehall
#! Die Hard
From: Scotland, Cold
Registered: 2009-01-17
Posts: 850
Website

Re: Japanese input please help

kujo wrote:
scottro wrote:

Sigh, I've really got to go to sleep (almost midnight here) so I hope my answer will be understandable.  smile

I think if you do, from a terminal

XMODIFIERS='@im=SCIM' LC_CTYPE=en_US.UTF-8 GTK_IM_MODULE="scim" firefox

that it will probably work. If that doesn't work, try changing en_US.UTF-8 (assuming that's your usual language, of course) to ja_JP.UTF-8

I'll give more of an explanation tomorrow (though probably not till the evening).  Just a really brief explanation---often all you need to do is set XMODIFIERS and LC_CTYPE.  I've found this to vary with distribution (and OS, e.g., the BSDs) and the application.  For example, Firefox is a GTK app so it will probably work with *either* ja_JP.UTF-8 OR GTK_IM_MODULE.  However, sometimes, it needs both.  I'm writing this from CentOS, so can't do a hands on test at this instant.

答え、ありがとうございました!!
_| ̄|●


Is that a "it works!"?

I can't read any non-latin based languages


Ex-KDE user.
Collects old PC's (Coz he can't afford new ones =P)
Crunchbang @ Distrowatch
My Blog (updated infrequently, and on the #! Planet too.)

Offline

#18 2009-03-14 00:47:53

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

The first two characters were kotae (answer) after that a thank you.  He was just thanking me for the answer. 

You should be able to read Asian characters, go to view=character encoding (or something similar--I'm in opera right now, and look for UTF-8.   smile

Offline

#19 2009-03-14 01:28:06

Mehall
#! Die Hard
From: Scotland, Cold
Registered: 2009-01-17
Posts: 850
Website

Re: Japanese input please help

scottro wrote:

The first two characters were kotae (answer) after that a thank you.  He was just thanking me for the answer. 

You should be able to read Asian characters, go to view=character encoding (or something similar--I'm in opera right now, and look for UTF-8.   smile


No, I could see most of the characters (the first one didn't show) I meant I literally do not comprehend them, whereas most latin-based languages I can sometimes get the gist of what is meant. (sometimes)

EDIT: but thakn you for clarifying [=

Last edited by Mehall (2009-03-14 01:28:23)


Ex-KDE user.
Collects old PC's (Coz he can't afford new ones =P)
Crunchbang @ Distrowatch
My Blog (updated infrequently, and on the #! Planet too.)

Offline

#20 2009-03-14 02:23:28

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

And thank you for clarifying as well, I didn't realize what you meant.   smile

Offline

#21 2009-08-13 22:03:33

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: Japanese input please help

Hey, thanks to you, scrotto, my #! can speak japanese now. But... is there a way to enable scim system wide? without the need to use XMODIFIERS for every program i want to start? It's a bit annoying when I have to restart pidgin, just because a japanese buddy comes online.


I'm so meta, even this acronym

Offline

#22 2009-08-14 00:48:56

scottro
#! Member
From: NYC
Registered: 2008-12-13
Posts: 68
Website

Re: Japanese input please help

I would put it in .bash_profile then, which would work each time you log in.  That is, in .bash_profile

export XMODIFIERS='@im=SCIM'
export LC_CTPYE=en_US.UTF-8
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"

Then, when you log in, do scim  -d in a terminal. That terminal can be closed as soon as it starts. (You might be able to do scim -d in .bash_profile as well.)

I haven't done it that way in awhile, but IIRC, that should work.

Offline

#23 2009-08-14 16:05:51

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: Japanese input please help

Thanks for repeating it. It seems to be in the thread. My bad big_smile


I'm so meta, even this acronym

Offline

#24 2009-08-14 16:18:37

Toolz
#! Die Hard
From: Asia
Registered: 2009-02-02
Posts: 937

Re: Japanese input please help

Is .bash_profile same as .bashrc?

Offline

Help fund CrunchBang, donate to the project!

#25 2009-08-14 17:06:43

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: Japanese input please help

Doesn't work. I press any of the hotkeys I set up and nothing happens. Only works when starting it per-app. sad

It works when I startx from a TTY, but not when I login as normal via GDM.

Last edited by Awebb (2009-08-14 17:25:06)


I'm so meta, even this acronym

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo