After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682851 - region: display language independent ibus engine correctly
region: display language independent ibus engine correctly
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Region & Language
unspecified
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 683089 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-08-28 05:21 UTC by Daiki Ueno
Modified: 2012-09-09 21:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
region: display language independent ibus engine correctly (1.36 KB, patch)
2012-08-28 05:21 UTC, Daiki Ueno
committed Details | Review

Description Daiki Ueno 2012-08-28 05:21:31 UTC
I got the following error when running gnome-control-center region after the blacklist patch (bug 682313) applied:

(gnome-control-center:19458): common-cc-panel-CRITICAL **: gdm_get_language_from_name: assertion `*name != '\0'' failed

and the engines are displayed as "(null) (latex)".

One idea is to add a check before gdm_get_language_from_name() and display it as "Other", but it may break string freeze.  How about using ibus_get_language_name() instead?
Comment 1 Daiki Ueno 2012-08-28 05:21:33 UTC
Created attachment 222609 [details] [review]
region: display language independent ibus engine correctly

ibus_engine_desc_get_language() may return an empty string for
language independent engines such as rawcode or latex.

Use ibus_get_language_name() instead of gdm_get_language_from_name()
to handle that case properly.
Comment 2 Bastien Nocera 2012-08-28 17:54:47 UTC
This isn't really a fix to me, and as the patch that creates this bug isn't merged, best discuss this in the original bug.

*** This bug has been marked as a duplicate of bug 682313 ***
Comment 3 Daiki Ueno 2012-08-28 19:31:36 UTC
No, this is not a duplicate of bug 682313, but the potential flaw already there.
I agree with that those bugs are related.
Comment 4 Daiki Ueno 2012-08-28 19:39:41 UTC
And why do you think this doesn't fix the problem?  ibus_get_language_name() takes care of the case where the argument is "", unlike gdm_get_language_from_name().  The function is already used in IBus code itself to display engines thus well tested.
Comment 5 Matthias Clasen 2012-08-30 00:57:08 UTC
I think we don't really want 'latex' and similar in the list...
Comment 6 Daiki Ueno 2012-08-30 08:14:56 UTC
Sure, then this should be indeed discussed in bug 682313.

*** This bug has been marked as a duplicate of bug 682313 ***
Comment 7 Rui Matos 2012-08-31 16:27:53 UTC
I think this patch should go in. Not for the original reason but because it fixes bug 683089 and also because it allows us to have consistent display strings for IBus sources in the gnome-shell menu as well. See bug 683124.

I have a WIP set of patches to move gdm-languages into gnome-desktop which would allow us to use it in gnome-shell as well but that won't make it for 3.6 and since IBus conveniently has this functionality readily accessible I think we should use it for now.

Longer term we really need a language/iso-codes library that we can use in GNOME.
Comment 8 Bastien Nocera 2012-09-05 18:21:06 UTC
*** Bug 683089 has been marked as a duplicate of this bug. ***
Comment 9 Bastien Nocera 2012-09-06 13:33:31 UTC
Review of attachment 222609 [details] [review]:

With Rui's OK, the code is good.
Comment 10 Rui Matos 2012-09-09 21:21:40 UTC
Pushed with a different commit summary and message. Thank you Daiki!