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 696043 - Show PO heaer entry with --help options
Show PO heaer entry with --help options
Status: RESOLVED FIXED
Product: gnome-mahjongg
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-mahjongg-maint
gnome-mahjongg-maint
Depends on:
Blocks:
 
 
Reported: 2013-03-18 09:45 UTC by Jiro Matsuzawa
Modified: 2013-03-19 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for the bug (424 bytes, patch)
2013-03-18 09:45 UTC, Jiro Matsuzawa
none Details | Review
Pass null to OptionContext() (462 bytes, patch)
2013-03-18 15:20 UTC, Jiro Matsuzawa
committed Details | Review

Description Jiro Matsuzawa 2013-03-18 09:45:34 UTC
Gnome-mahjongg shows a PO header entry with the --help option.
This problem is the same as the Bug 695997. Please see it for more details.

Problem
=======

$ LANG=es_ES.utf8 gnome-mahjongg --help
Uso:
  gnome-mahjongg [OPCIÓN…] Project-Id-Version: gnome-games.master
Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-mahjongg&keywords=I18N+L10N&component=general
POT-Creation-Date: 2013-01-28 23:17+0000
PO-Revision-Date: 2013-01-30 14:17+0100
Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>
Language-Team: Español <gnome-es-list@gnome.org>
Language: es
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n!=1);
X-Generator: Gtranslator 2.91.5
X-Project-Style: gnome


Opciones de ayuda:
  -h, --help                  Mostrar opciones de ayuda
  --help-all                  Muestra todas las opciones de ayuda
  --help-gtk                  Mostrar opciones GTK+

Opciones de la aplicación:
  --display=VISOR             Visor [display] X que usar
Comment 1 Jiro Matsuzawa 2013-03-18 09:45:59 UTC
Created attachment 239108 [details] [review]
Patch for the bug

I've attached a patch for the bug. Please see the Bug 695997#c1 for more details about the patch.

https://bugzilla.gnome.org/show_bug.cgi?id=695997#c1
Comment 2 Christian Persch 2013-03-18 11:43:17 UTC
         var context = new OptionContext ("");
-        context.set_translation_domain (GETTEXT_PACKAGE);

The patch is wrong. Turning off the translations isn't the anwer; rather the problem is passing "" instead of NULL when creating the option context.
Comment 3 Jiro Matsuzawa 2013-03-18 12:39:00 UTC
Thank you for the review.

First, I don't disable any translation. Users can get the translated help and GUI.

Do you mean that we need to pass null to OptionContext()? But the GLib documents don't say that null is permitted [1]. In fact, I got the following warning. If I make any mistakes, I'm sorry about that.

$ jhbuild make
(snip)
Making all in src
make[1]: Entering directory `/opt/gnome/checkout/gnome-mahjongg/src'
  VALAC  gnome_mahjongg_vala.stamp
game-view.vala:197.27-197.30: warning: Rsvg has been deprecated since 2.36.2. Use bindings distributed with librsvg-2.0
game-view.vala:140.20-140.23: warning: Rsvg has been deprecated since 2.36.2. Use bindings distributed with librsvg-2.0
gnome-mahjongg.vala:735.42-735.45: warning: Argument 1: Cannot pass null to non-null parameter type
        var context = new OptionContext (null);
                                         ^^^^
Compilation succeeded - 3 warning(s)
(snip)
$ jhbuild run valac --version
Vala 0.19.0.4-1540d


[1] https://developer.gnome.org/glib/unstable/glib-Commandline-option-parser.html#g-option-context-new
Comment 4 Christian Persch 2013-03-18 13:14:56 UTC
That's just some missing gobject-introspection annotations. Fixed on glib master and gtk+ master and 3-8, and going on g-o-i soon. Not sure how the vala bindings are updated, you may need to file a separate bug for them?
Comment 5 Christian Persch 2013-03-18 13:26:03 UTC
Filed as vala bug 696055.
Comment 6 Jiro Matsuzawa 2013-03-18 15:20:17 UTC
Created attachment 239144 [details] [review]
Pass null to OptionContext()

Thank you! I reworked the patch to pass null. (But, as you know, the vala warning remains)
Comment 7 Jiro Matsuzawa 2013-03-19 13:08:31 UTC
Review of attachment 239144 [details] [review]:

Commited:
4658709ba0347c12285e102284cfe21c8f3966e2

Thank you.