IBus
From Gentoo Wiki
IBus (Intelligent Input Bus) is an open source input framework for Linux and Unix.
Installation
Except for the basic IBus framework, one or more engines should be installed. For example:
root # emerge --ask ibus ibus-pinyinHave a look at the eix output for more available engines:
user $ eix -c ibus -I app-i18nFor graphical toolkit integration, app-i18n/ibus offers gtk (this refers to gtk+:2) and gtk3 useflags, and there is a separate app-i18n/ibus-qt package for Qt (including KDE) as well.
You can use app-i18n/im-chooser for selecting your preferred input method.