Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer does not write input method variables into /etc/locale.conf #529

Open
calamares-user opened this Issue Jun 20, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@calamares-user
Copy link

calamares-user commented Jun 20, 2016

Jira issue originally created by user yochenhsieh:

There are some variables that should be written into system locale config (in openMandriva it's /etc/locale.conf):
XIM=
GTKIMMODULE=
QTIMMODULE=
XIM_PROGRAM=
XMODIFIERS=

Missing these variables will cause input method (e.g. ibus,fcitx) unusable after installed. It is needed that a default value should be set for certain specific locales, e.g. CJK.

@calamares-user

This comment has been minimized.

Copy link
Author

calamares-user commented Jun 21, 2016

Comment created by @teo:

Those variables don't seem to be documented in the fd.o spec [https://www.freedesktop.org/software/systemd/man/locale.conf.html].
Are you sure they belong in locale.conf and not in some other file?
Can you provide any documentation for them?

@calamares-user

This comment has been minimized.

Copy link
Author

calamares-user commented Jun 21, 2016

Comment created by yochenhsieh:

I think the wiki of fedora is one of the more neutral documentation:
https://fedoraproject.org/wiki/I18N/InputMethods
Each distribution has their own ways setting input method variables. I'm sorry that perhaps I should report this be a improvement instead of a bug: is it possible for calamares to write additional variables to locale.conf, e.g. input methods?

@calamares-user

This comment has been minimized.

Copy link
Author

calamares-user commented Jun 21, 2016

Comment created by @teo:

I'd be ok with supporting this, but I still don't understand which exact values need to be set there and when. That wiki page you linked actually says that GTK and Qt load the input method automatically.

@calamares-user

This comment has been minimized.

Copy link
Author

calamares-user commented Jun 21, 2016

Comment created by yochenhsieh:

This is an example of ibus for each of the variable:
GTKIMMODULE=ibus
QTIMMODULE=ibus
XIM_PROGRAM="ibus-daemon -d -x"
XMODIFIERS=@im=ibus
and this is for fcitx:
GTKIMMODULE=fcitx
QTIMMODULE=fcitx
XIM=fcitx
XIM_PROGRAM=fcitx
XMODIFIERS=@im=fcitx

When the variables are set, GTK and QT programs will know which input methods they should use, and user press specific hot-key to activate input methods for their language. Many distribution only use one input method platform/framwork as the default for all languages that need input methods.

I'm testing two distro that forked from Mandriva: mageia and openMandriva. Mageia still uses a perl-based installer that was developed since the days of Mandriva. The locale and input method is handled by a perl module here:
http://gitweb.mageia.org/software/drakx/tree/perl-install/lang.pm (It still works nicely, thanks to mageia devs.)

On the other hand, openMandriva choose calamares for live-installer. The variables mentioned seem not written when I tried to install Chinese (Taiwan) locale. I also reported the bug to openMandriva and a developer tries to fix it at xinit scripts level. The reason I want the variables in locale.conf is because, openMandriva also has their version of perl-based control center (mostly like the one of mageia, since both forked from Mandriva), and the locale and input method configtool reads config from locale.conf.

So it would be great if it's possible the variables could be written at installation. But I will also check how the xinitrc part progresses. Thank you for spending time on this.:)

@calamares-user

This comment has been minimized.

Copy link
Author

calamares-user commented Jun 28, 2016

Comment created by @teo:

Ok, I've managed to take a look at that Perl module. I had no idea it would be this complex. So basically, writing those variables is the easiest bit, the hard part is porting over all the tables and guesswork from the Perl module, so Calamares can know for which language to set what.
Maybe the openMandriva developer that's working on the xinit fix might like to join us here? I'm thinking we all want to improve the openMandriva install process, so he might be able and willing to help out.

@calamares-user

This comment has been minimized.

Copy link
Author

calamares-user commented Jun 28, 2016

Comment created by yochenhsieh:

Hi, he/we managed to export variables at xinit stage in this script:
https://github.com/OpenMandrivaAssociation/xinitrc/blob/master/xinitrc-XIM

Roughly I think line 16~32 do the job when x session starts. It only exports variables so locale.conf is untouched. Tomasz Paweł Gajc helped a lot to implement CJK support in openMandriva.

@calamares-user

This comment has been minimized.

Copy link
Author

calamares-user commented Jun 30, 2016

Comment created by TPG:

First we should answer one question:

  1. Should calamares support more than one IM ?

If "yes" then this topic is going to be not so easy.

When "no" then doing simple way:

https://github.com/calamares/calamares/blob/master/src/modules/localecfg/main.py

I'm not an python expert, so this below is pseudocode
if locale(zh,ja,ko,jp,xxx):
localeconf.write("GTK_IM_MODULE=fcitx\n".format(localesplit))
localeconf.write(QT_IM_MODULE=fcitx\n".format(localesplit))
localeconf.write(XIM=fcitx\n".format(localesplit))
localeconf.write(XIM_PROGRAM=fcitx\n".format(localesplit))
localeconf.write(XMODIFIERS=@im=fcitx\n".format(localesplit))

@abucodonosor

This comment has been minimized.

Copy link
Contributor

abucodonosor commented Sep 7, 2017

tbh .. none of these should be supported by calamares itself and there are reasons.

When calamares does this based on language detection this can break the 'distro'
implementatiton. Also for all this to work 'ibus and some more other packages' need
be installed.. we really can't expect calamares to check whatever packages get installed,
what kind IM methode the user wishes and so on..

Also this kind setup of variables is usualy done when 'installing the packages from your distro' ..

@abucodonosor abucodonosor changed the title CAL-377: Installer does not write input method variables into /etc/locale.conf Installer does not write input method variables into /etc/locale.conf Sep 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.