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 695997 - Show PO heaer entry with --help options
Show PO heaer entry with --help options
Status: RESOLVED FIXED
Product: gnome-mines
Classification: Applications
Component: general
git master
Other Linux
: High major
: ---
Assigned To: gnome-mines-maint
gnome-mines-maint
Depends on:
Blocks:
 
 
Reported: 2013-03-17 15:08 UTC by Jiro Matsuzawa
Modified: 2013-03-19 13:05 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
Patch for the bug (423 bytes, patch)
2013-03-18 07:34 UTC, Jiro Matsuzawa
none Details | Review
Do not translate empty string (952 bytes, patch)
2013-03-19 07:16 UTC, Jiro Matsuzawa
committed Details | Review

Description Jiro Matsuzawa 2013-03-17 15:08:37 UTC
Problem
=======
gnome-mines or other apps from gnome-games shows a PO header entry with the --help option.
The problem occurs on any locales. So, this is not a problem of tranlations.

When LANG=es_ES.utf8
---------------------
$ LANG=es_ES.utf8 gnome-mines --help
Uso:
  gnome-mines [OPCIÓN…] Project-Id-Version: gnome-games.master
Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-mines&keywords=I18N+L10N&component=general
POT-Creation-Date: 2013-02-15 08:01+0000
PO-Revision-Date: 2013-02-19 12:29+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


When LANG=de_DE.utf8
---------------------
$ LANG=de_DE.utf8 gnome-mines --help
Aufruf:
  gnome-mines [OPTION …] Project-Id-Version: gnome-mines master
Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-mines&keywords=I18N+L10N&component=general
POT-Creation-Date: 2013-02-15 08:01+0000
PO-Revision-Date: 2013-02-27 20:03+0100
Last-Translator: Mario Blättermann <mario.blaettermann@gmail.com>
Language-Team: Deutsch <gnome-de@gnome.org>
Language: 
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n != 1);
X-Poedit-Language: German
X-Poedit-Country: GERMANY
X-Generator: Gtranslator 2.91.5


Hilfeoptionen:
  -h, --help                  Hilfeoptionen anzeigen
  --help-all                  Alle Hilfeoptionen anzeigen
  --help-gtk                  GTK+-Optionen anzeigen

Anwendungsoptionen:
  --display=ANZEIGE           X-Anzeige, die verwendet werden soll


When LANG=C
-----------
$ LANG=C gnome-mines --help
Usage:
  gnome-mines [OPTION...] 

Help Options:
  -h, --help               Show help options
  --help-all               Show all help options
  --help-gtk               Show GTK+ Options

Application Options:
  --display=DISPLAY        X display to use


Expected Result
===============
a PO header entry is not output.


How to Reproduce
================
1. Set the LANG (or LC_ALL) environment variable to any locale other than C.
2. Launch gnome-mines
Comment 1 Jiro Matsuzawa 2013-03-18 07:34:18 UTC
Created attachment 239096 [details] [review]
Patch for the bug

I wrote a patch for the problem. I'd like to apply it before the 3.8 release.

Gnome-mines doesn't have its own option information. So, it doesn't need to set the translation domain of the option context.  The patch doesn't have any effect on the GUI. Users can get translated GUI.

After Applying the Patch
========================
$ LANG=es_ES.utf8 gnome-mines --help
Uso:
  gnome-mines [OPCIÓN…] 

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

$ LANG=C gnome-mines --help
Usage:
  gnome-mines [OPTION...] 

Help Options:
  -h, --help               Show help options
  --help-all               Show all help options
  --help-gtk               Show GTK+ Options

Application Options:
  --display=DISPLAY        X display to use


--
BTW, I looked into glib/goption. I'm wondering if we could prevent this problem by making a slight modification to goption not to gettext empty strings.
Comment 2 Jiro Matsuzawa 2013-03-18 10:00:28 UTC
I've checked each module from gnome-games following the announcement of GNOME Games split [1].

Result
======
gnome-chess: NotNeeded
five-or-more: NotNeeded
four-in-a-row: NotNeeded
gnome-nibbles: NotNeeded
gnome-robots: NotNeeded
gnome-sudoku: NotNeeded
gnome-mines: Bug 695997 (here)
gnome-tetravex: NotNeeded
gnome-klotski: Bug 696038
tali: NotNeeded
iagno: Bug 696042
lightsoff: NotNeeded
gnome-mahjongg: Bug 696043
quadrapassel: NotNeeded
swell-foop: Bug 696044


[1] https://mail.gnome.org/archives/games-list/2012-October/msg00000.html
Comment 3 Jiro Matsuzawa 2013-03-18 15:37:10 UTC
On the bug 696043 (gnome-mahjongg), Christian Persch advised me to pass null to OptionContext() instead of removing the translation domain. It is another answer for this problem. However, valac outputs an warning "Cannot pass null to
non-null parameter type" [1]. Christian filed about this as bug 696055. If we may ignore the warning, I'll rework my patch as Christian says. Any suggestions welcome.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=696043#c3
Comment 4 Jiro Matsuzawa 2013-03-19 07:16:08 UTC
Created attachment 239219 [details] [review]
Do not translate empty string

The bug 696055 has been fixed. Now we can pass null to OptionContext() without warnings. I reworked my patch to pass null instead of an empty string.
Comment 5 Jiro Matsuzawa 2013-03-19 13:05:03 UTC
Review of attachment 239219 [details] [review]:

commited: 32e7bf7bece035f26e577206deee2aa846b43598