AppImageKit icon indicating copy to clipboard operation
AppImageKit copied to clipboard

AppImages don't work with non-English input

Open vadi2 opened this issue 7 years ago • 16 comments
trafficstars

Steps to reproduce:

  1. On Ubuntu (18.04LTS in my case) change the input language to Russian phonetic
  2. Type into the Firefox browser, GTK+ app, Qt app - text will be Cyrillic
  3. Type into a Qt app running from AppImage (like Tiled) - text is English, not Cyrillic
  4. Type into same Qt app running without AppImage - text is correctly Cyrillic

vadi2 avatar Aug 31 '18 09:08 vadi2

I'm an app developer now branching into i18n and I'm hit by this - are there any known fixes?

vadi2 avatar Aug 31 '18 09:08 vadi2

Probably more an issue for linuxdeploy(qt).

I doubt it's an AppImage related issue. Does the behavior change when extracting the AppImage?

AppImageLauncher's AppImage is coming with some Russian translations, too, maybe you could try its AppImage and see whether you can reproduce the issue: https://github.com/TheAssassin/AppImageLauncher/releases

TheAssassin avatar Aug 31 '18 11:08 TheAssassin

AppImageLauncher-travis287-git20180830.ba45feb-x86_64.AppImage seems to be a command-line tool without any Qt UIs I can input text into, how do you mean to use it?

vadi2 avatar Aug 31 '18 12:08 vadi2

It's a UI that is supposed to be called on AppImages by the system. That's a bit counterintuitive I guess. Please call from the CLI like ./AppImageLauncher*.AppImage <some other AppImage, not AppImageLauncher itself>.

TheAssassin avatar Aug 31 '18 12:08 TheAssassin

Okay - I did ./AppImageLauncher-travis287-git20180830.ba45feb-x86_64.AppImage ./Tiled-1.1.6-x86_64.AppImage and Tiled still had the same problem.

vadi2 avatar Aug 31 '18 12:08 vadi2

@vadi2 was AppImageLauncher's UI in Russian, though? That's what I wanted to know, actually, as I know AppImageLauncher ships with Russian translations.

TheAssassin avatar Aug 31 '18 12:08 TheAssassin

My system is in English, I only use Russian with a few select applications (and even then I prefer an English UI).

vadi2 avatar Aug 31 '18 12:08 vadi2

Potentially a Qt Input Method plugin needs to be bundled in the AppDir.

Usage examples:

-extra-plugins=sqldrivers/libqmsql.so,iconengines/libqsvgicon.so
-extra-plugins=sqldrivers,iconengines/libqsvgicon.so
-extra-plugins=sqldrivers,iconengines,mediaservice,gamepads

Of course you need to specify the corresponding input method plugin(s).

Does this help?

(Why Qt requires a plugin to accept foreign text is a mystery to me.)

probonopd avatar Aug 31 '18 18:08 probonopd

How would I identify such plugins?

vadi2 avatar Aug 31 '18 19:08 vadi2

Look for inputplugins in your Qt installation. Let me know if you need a copy-paste example.

probonopd avatar Sep 01 '18 10:09 probonopd

I've added platforminputcontexts/libcomposeplatforminputcontextplugin.so and platforminputcontexts/libibusplatforminputcontextplugin.so - confirmed that they are deployed - but no luck still.

vadi2 avatar Sep 01 '18 13:09 vadi2

Interesting. Not sure what to do then, we need someone who knows more about the inner workings of Qt.

I found

plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
plugins/platforminputcontexts/libibusplatforminputcontextplugin.so
plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so

I am not sure what they all do but I think we need to experiment. (These I found by looking at a Qt 5.8 installation and searching for "input".)

probonopd avatar Sep 02 '18 10:09 probonopd

Hi @vadi2, did including the plugins mentioned above solved your issue?

azubieta avatar Nov 27 '18 04:11 azubieta

No.

vadi2 avatar Nov 27 '18 04:11 vadi2

@vadi2 can you please point us to the AppImage that includes the above-mentioned plugins and still has the issue? This will greatly help us in debugging. Thanks.

(Most likely this issue will need to be moved to linuxdeployqt since it is most likely not an AppImage tools issue but rather an issue with what happens to be inside this particular AppImage.)

probonopd avatar Nov 28 '18 06:11 probonopd

I am using an existing AppImage modified to support Japanese input. I hope that sharing this hack will lead to a fundamental solution to this issue.


Currently, AppImage does not work well under fcitx5+mozc. The reason for this depends on the application framework.

GTK

In AppRun, you need to define GTK_IM_MODULES_FILE.

example:

PLATFORM=x86_64-linux-gnu
export GCONV_PATH="$HERE/usr/lib/$PLATFORM/gconv"
export FONTCONFIG_FILE="$HERE/etc/fonts/fonts.conf"
export GTK_EXE_PREFIX="$HERE/usr"
export GDK_PIXBUF_MODULEDIR=$(readlink -f "$HERE"/usr/lib/$PLATFORM/gdk-pixbuf-*/*/loaders/ )
export GDK_PIXBUF_MODULE_FILE=$(readlink -f "$HERE"/usr/lib/$PLATFORM/gdk-pixbuf-*/*/loaders.cache ) 
export GI_TYPELIB_PATH="$HERE/usr/lib/$PLATFORM/girepository-1.0"
export GTK_IM_MODULES_FILE="$HERE/usr/lib/gtk-3.0/3.0.0/immodules.cache"
export XDG_DATA_DIRS="$HERE/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
LIBRARY_PATH="$HERE/lib/$PLATFORM"
LIBRARY_PATH+=":$HERE/usr/lib/$PLATFORM"
LIBRARY_PATH+=":$HERE/usr/lib"
LIBRARY_PATH+=":$GDK_PIXBUF_MODULEDIR" 
export LD_LIBRARY_PATH="$GDK_PIXBUF_MODULEDIR"
  • $HERE/usr/lib/gtk-3.0/3.0.0/immodules.cache is copy of or symlink to /usr/lib/gtk-3.0/3.0.0/immodules.cache

QT

Add libfcitx5platforminputcontextplugin.so.

ghost avatar Jun 27 '23 07:06 ghost