个人工具

“UbuntuHelp:JapaneseInput”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/JapaneseInput}} {{Languages|UbuntuHelp:JapaneseInput}} '''Works well on Dapper too.''' This method uses uim and its anthy plugin. == Installing ...)
 
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/JapaneseInput}}
 
{{From|https://help.ubuntu.com/community/JapaneseInput}}
 
{{Languages|UbuntuHelp:JapaneseInput}}
 
{{Languages|UbuntuHelp:JapaneseInput}}
'''Works well on Dapper too.'''
 
  
This method uses uim and its anthy plugin.
+
This method uses uim and its anthy plugin.  It assumes you want to type Japanese from an English session, not as a Japanese user.
  
 
== Installing the packages ==
 
== Installing the packages ==
第13行: 第12行:
 
</nowiki></pre>
 
</nowiki></pre>
  
Normally, all the necessary dependencies should be pulled by the package manager, including the ''im-switch'' utility.
+
Normally, all the necessary dependencies should be pulled by the package manager
  
 
'''Note''': you need to have the UniversePackages repository configured.
 
'''Note''': you need to have the UniversePackages repository configured.
  
At this point, the system is ready to input japanese if you log in a Japanese session. If you don't want to be able to input Japanese in other language sessions, you can skip the next section and directly go to the ''using the uim applet '' section.
+
== Using the uim applet ==
  
== Setting the input method ==
+
Add the UIM Applet to the panel.  (Right click on the panel> Add to panel...).
  
But if you want to type in Japanese from an other language session (this is quite the usual case), you can use the ''im-switch'' utility to set the input method for only your account or all the users.
+
Click the "Preference" button on the applet.  If you are only interested in Japanese and English, click "Edit" for the "Enabled input methods" and remove all methods except "Anthy."  Consider unchecking "Enable input method toggle by hot keys."  I always accidentally hit the keys (Ctrl-space by default) and get jumped into Japanese mode when I don't want it.  You can instead use the mouse to deliberately select Japanese input mode from the applet.  Click "OK" to exit configuration.  It might be necessary to log out and log back in.  I've seen some flaky behavior from the applet after configuring it without a restart.
  
In a terminal, type the following:
+
To try out inputting Japanese, launch a text editor, such as Gedit.  Click on the input mode selector in the UIM applet and select Anthy, or hit Ctrl-space if you did not disable keyboard toggling. By default you should still be in direct input mode under Anthy and typing will produce English characters. Hit shift-space to toggle into Japanese input mode. If the UIM Applet input mode logo does not say あ, indicating hiragana mode, either click on the applet and select hiragana mode (ひらがな) or press shift-F6. Type "nihongo", press space, press enter and you should see "日本語" (literally, Japanese Language). Hit shift-space and then type some English.  Hit shift-space and type some more Japanese. Type "ka" and hit space to cycle through the potential kanji matches, then hit enter when you find the right one. Press shift-F7 to enter katakana, then press shift-F6 when you want to go back to hiragana input. When you're done typing Japanese altogether, click on the UIM applet and select "Direct" mode instead of "Anthy", or hit Ctrl-space if you did not disable it.
 
+
<pre><nowiki>
+
im-switch -s uim_anthy
+
</nowiki></pre>
+
 
+
'''Note''':
+
This will not work in edgy or above, because the uim_anthy script is missing due to a [https://launchpad.net/ubuntu/+source/uim/+bug/70484 packaging bug].
+
To work around, download the [http://packages.ubuntu.com/dapper/libs/uim-anthy dapper-package] and then type the following in a terminal in the directiory where you saved the package:
+
<pre><nowiki>
+
dpkg -x uim-anthy_1.0.0-1ubuntu1_i386.deb uim-package
+
sudo cp uim-package/etc/X11/xinit/xinput.d/uim_anthy /etc/X11/xinit/xinput.d/uim_anthy
+
</nowiki></pre>
+
 
+
It will set the default input method for your user account and you current language, but you can set it for a given language session. For example, you could use:
+
 
+
<pre><nowiki>
+
im-switch -z fr_FR -s uim_anthy
+
</nowiki></pre>
+
 
+
to associate the uim-anthy input method to the French session of your account.
+
 
+
uim allows you to type traditionally, so you can also launch ''im-switch'' as administrator to set the default input method for all the users without any side effect:
+
 
+
<pre><nowiki>
+
sudo im-switch -s uim_anthy
+
</nowiki></pre>
+
 
+
Note that user settings prevail over the system ones, so a user you can always override the default input method.
+
 
+
== Using the uim applet and testing ==
+
 
+
Now you can just log out and log back into the desktop and add the applet named ''Uim applet'' on one of your panels (Right click on the panel> Add to panel...).
+
 
+
To try out inputting Japanese, launch the '''Gedit text editor'''. At this point, the selected GTK input method should be uim. You can check that right-clicking on the text component and just hovering over the ''Input Methods'' item to check uim is selected. If it's not, you can always set it from there.
+
 
+
Type something - it should be ordinary roman text. Press Shift-Space, however, and type "watashi". It should come out as Hiragana "わたし" (it is Japanese for "I"). If you have the panel applet in the panel, it should change to reflect that you are typing Hiragana. Press Return to "fix" the word, or press Space to convert it to a Kanji (you want "私"). If you got the wrong Kanji, press Space again to get a selection to choose from. Once you've got the right one, press Return. To type ordinary roman text again, just press Shift-Space once more.
+
 
+
Notice how the applet display change when you switch of input type.
+
You're typing Japanese!
+
  
 
== What's next? ==
 
== What's next? ==
第68行: 第28行:
 
Now you can check the settings in the applet to find out more about the different keys you can type to have more control over the input.
 
Now you can check the settings in the applet to find out more about the different keys you can type to have more control over the input.
  
I suggest to also try the new '''Language selector''' tool (''System> Administration'' menu) to add the writing aids for the Japanese such as the dictionary.
+
Consider adding Japanese support through the new '''Language selector''' tool (''System> Administration> Language Support'') to get writing aids such as a dictionary, and also to generate appropriate locales.
  
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月22日 (四) 13:17的版本


This method uses uim and its anthy plugin. It assumes you want to type Japanese from an English session, not as a Japanese user.

Installing the packages

Either use the Synaptic Package Manager (System> Administration menu) to install the following packages or type the lines in a terminal:

sudo apt-get install uim-applet-gnome uim-xim uim-anthy uim-gtk2.0

Normally, all the necessary dependencies should be pulled by the package manager

Note: you need to have the UniversePackages repository configured.

Using the uim applet

Add the UIM Applet to the panel. (Right click on the panel> Add to panel...).

Click the "Preference" button on the applet. If you are only interested in Japanese and English, click "Edit" for the "Enabled input methods" and remove all methods except "Anthy." Consider unchecking "Enable input method toggle by hot keys." I always accidentally hit the keys (Ctrl-space by default) and get jumped into Japanese mode when I don't want it. You can instead use the mouse to deliberately select Japanese input mode from the applet. Click "OK" to exit configuration. It might be necessary to log out and log back in. I've seen some flaky behavior from the applet after configuring it without a restart.

To try out inputting Japanese, launch a text editor, such as Gedit. Click on the input mode selector in the UIM applet and select Anthy, or hit Ctrl-space if you did not disable keyboard toggling. By default you should still be in direct input mode under Anthy and typing will produce English characters. Hit shift-space to toggle into Japanese input mode. If the UIM Applet input mode logo does not say あ, indicating hiragana mode, either click on the applet and select hiragana mode (ひらがな) or press shift-F6. Type "nihongo", press space, press enter and you should see "日本語" (literally, Japanese Language). Hit shift-space and then type some English. Hit shift-space and type some more Japanese. Type "ka" and hit space to cycle through the potential kanji matches, then hit enter when you find the right one. Press shift-F7 to enter katakana, then press shift-F6 when you want to go back to hiragana input. When you're done typing Japanese altogether, click on the UIM applet and select "Direct" mode instead of "Anthy", or hit Ctrl-space if you did not disable it.

What's next?

Now you can check the settings in the applet to find out more about the different keys you can type to have more control over the input.

Consider adding Japanese support through the new Language selector tool (System> Administration> Language Support) to get writing aids such as a dictionary, and also to generate appropriate locales.