Fcitx

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Fcitx and the translation is 77% complete.
Outdated translations are marked like this.
Other languages:
Resources

Fcitx (Flexible Context-aware Input Tool with eXtension support) [ˈfaɪtɪks] 是 一个支持扩展的输入法框架,它支持许多种语言和脚本。

Fcitx (Flexible Context-aware Input Tool with eXtension support) [ˈfaɪtɪks] is an input method framework with support for many languages and scripts.

安装

USE 标记

USE flags for app-i18n/fcitx Fcitx 5 is a generic input method framework

X Add support for X11
autostart Enable XDG-compatible autostart of Fcitx
cairo Enable support for the cairo graphics library
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
emoji Enable emoji loading for CLDR
enchant Enable Enchant backend (using app-text/enchant) for spelling hinting
gtk2 Install input method module for GTK+ 2
gtk3 Install input method module for GTK+ 3
introspection Add support for GObject based introspection
keyboard Enable key event translation with XKB and build keyboard engine
lua Enable Lua scripting support
nls Add Native Language Support (using gettext - GNU locale utilities)
opencc Enable OpenCC engine (using app-i18n/opencc) for converter between Simplified Chinese and Traditional Chinese
pango Enable support for x11-libs/pango
presage Enable presage for word predication (not stable)
server Build a fcitx as server, disable this option if you want to use fcitx as an embedded library
systemd Enable use of systemd-specific libraries and features like socket activation or session tracking
table Install table input methods for Simplified Chinese
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
wayland Enable dev-libs/wayland backend
xkb Enable support for XKB (required for fcitx-xkb, fcitx-xkbdbus, part of fcitx-keyboard)

附注
强烈建议在安装使用这些工具包的应用程序时添加gtk2gtk3 USE标记。

Emerge

root #emerge --ask app-i18n/fcitx

使用 Fcitx

为了在X中使用Fcitx,必须在启动文件中添加以下环境变量:

使用GDM,KDM或LightDM等登录管理器启动X服务时,将它们添加到~/.xprofile文件中。 使用startx命令或SLiM登录时,将它们添加到~/.xinitrc文件中。

如果在安装时使用gtk2gtk3 USE标记,<module>(如下面的示例中)应是fcitx,否则应是xim

文件 ~/.xprofile
export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE=<module>
export GTK_IM_MODULE=<module>

请记住,只有使用startx或SLiM启动X服务时,才能使~/.xinitrc看起来像下面的示例:

文件 ~/.xinitrc
export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE=<module>
export GTK_IM_MODULE=<module>

KDE Plasma: If these environment variables are not getting loaded either from ~/.xprofile nor ~/.xinitrc, try adding them to a Plasma startup script, such as ~/.config/plasma-workspace/env/fcitx.sh.

建议在Fcitx启动前启动D-Bus会话总线。将这些添加到X启动文件的开头~/.xprofile~/.xinitrc):

文件 ~/.xprofile or ~/.xinitrc
eval "$(dbus-launch --sh-syntax --exit-with-session)"
文件 ~/.xinitrc
eval "$(dbus-launch --sh-syntax --exit-with-session)"
警告
当希望在X中使用Fcitx时,系统的locale 不能C 或P OSIX

配置

编辑Fcitx的配置文件 ~/.config/fcitx/config

此外,还有GUI工具来配置Fcitx。安装app-i18n/fcitx-configtool(基于GTK2或GTK3)或app-i18n/kcm-fcitx(基于KDE)来使用它们。

前端

除了内置的经典UI之外,还有一个前端集成到KDE中,称为Kimpanel(包含在kde-plasma/kdeplasma-addons中)。必须启用dbus标志才能使用Kimpanel。安装完成后,将kimpanel plasmoid添加到plasma面板上,fcitx将自动切换。

特定的语言支持

中文

Fcitx本身具有内置拼音支持。启用table USE标志将提供多个基于表的输入法,如WuBi和Ziranma。

安装app-i18n/fcitx-cloudpinyin以获得更好的候选词列表。

内置拼音使用简单算法,还有其他拼音输入法使用其他算法。 安装app-i18n/fcitx-sunpinyinapp-i18n/fcitx-libpinyinapp-i18n/fcitx-rime即可使用它们。

可以安装app-i18n/fcitx-chewingapp-i18n/fcitx-libpinyin以支持Bopomofo。

安装app-i18n/fcitx-table-extra以支持Cangjie或Boshiamy。

日文

安装 app-i18n/fcitx-anthy

root #emerge --ask app-i18n/fcitx-anthy

韩文

安装 app-i18n/fcitx-hangul:

root #emerge --ask app-i18n/fcitx-hangul

越南文

安装 app-i18n/fcitx-unikey

root #emerge --ask app-i18n/fcitx-unikey