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 730532 - Error regenerating POT file
Error regenerating POT file
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-21 17:39 UTC by Enrico Nicoletto
Modified: 2014-06-14 23:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
version 0 (untested!) (13.48 KB, patch)
2014-05-22 15:00 UTC, Egmont Koblinger
reviewed Details | Review
v2 (13.51 KB, patch)
2014-06-09 21:37 UTC, Egmont Koblinger
committed Details | Review
-Werror workaround (336 bytes, patch)
2014-06-14 20:37 UTC, Egmont Koblinger
committed Details | Review

Description Enrico Nicoletto 2014-05-21 17:39:49 UTC
In gnome-terminal module page, displayed in Damned Lies, the folllowing error message is shown:

* Following files are referenced in either POTFILES.in or POTFILES.skip, yet they don't exist:  * src/client.c

* Error regenerating POT file for gnome-terminal:
intltool-update -g 'gnome-terminal' -p
xgettext: error while opening "./../src/client.c" for reading: No such file or directory
ERROR: xgettext failed to generate PO template file. Please consult
       error message above if there is any.

Please, may some debug to discover what is going on?

Thanks,
Enrico Nicoletto.
Comment 1 Egmont Koblinger 2014-05-22 15:00:05 UTC
Created attachment 276995 [details] [review]
version 0 (untested!)

I think it's a trivial change to POTFILES.in, but it should preferably go with i18n support in gterminal.vala.

I created a patch, but haven't tested it yet, might not work :)
Comment 2 Christian Persch 2014-05-22 18:37:00 UTC
I didn't add i18n to gterminal since I had problems with include order (config.h wasn't being included first...)
Comment 3 Christian Persch 2014-05-22 18:55:18 UTC
Review of attachment 276995 [details] [review]:

If it works, ok to commit with the comments fixed.

::: src/Makefile.am
@@ +193,3 @@
 # See bug #710862 about -Wsuggest-attribute=format
 gterminal_CFLAGS = \
+	-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \

This should go to gterminal_CPPFLAGS not CFLAGS.

::: src/gterminal.vala
@@ +42,3 @@
       var group = new GLib.OptionGroup ("output",
+                                        N_("Output options:"),
+                                        _("Show output options"),

N_ here too.

@@ +94,3 @@
     private static const OptionEntry[] entries = {
       { "app-id", 0, OptionFlags.HIDDEN, OptionArg.CALLBACK, (void*) option_app_id,
+        N_("Server application ID"), "ID" },

N_("ID")

@@ +101,3 @@
     {
       var group = new GLib.OptionGroup ("global",
+                                        _("Global options:"),

N_

@@ +182,2 @@
       { "fd", 0, 0, OptionArg.STRING_ARRAY, ref pass_fds,
+        N_("Forward file descriptor"), "FD" },

N_("FD")

@@ +215,1 @@
         "GEOMETRY" },

N_

@@ +222,3 @@
     {
       var group = new GLib.OptionGroup ("window",
+                                        _("Window options:"),

N_

And so one for all the rest too :-)
Comment 4 Egmont Koblinger 2014-06-09 21:35:40 UTC
(Oh how much I hate that bugzilla doesn't auto-cc myself if I attach a patch... I completely forgot about this issue.)
Comment 5 Egmont Koblinger 2014-06-09 21:37:18 UTC
Created attachment 278166 [details] [review]
v2

Partially tested.  How to print any of the _N() strings?  --help doesn't work.
Comment 6 Christian Persch 2014-06-14 07:20:51 UTC
N_() just marks the string for extraction by xgettext. GOption does the translation internally, that's what the set_translation_domain calls are for.

Looks good code-wise, but does it actually build? When I tried to add i18n to this before, it broke because config.h was not the first thing included in the valac-generated C ?
Comment 7 Egmont Koblinger 2014-06-14 07:26:33 UTC
(In reply to comment #6)
> Looks good code-wise, but does it actually build?

It does, and I've checked some run-time translated strings (e.g. error parsing cmd line) that are indeed translated. I have valac 0.22.1.

> When I tried to add i18n to
> this before, it broke because config.h was not the first thing included in the
> valac-generated C ?

I had this problem at my first attempt too, when (following Google's advices) I tried to define GETTEXT_PACKAGE in the source code. Moving it to Makefile fixed it.
Comment 8 Christian Persch 2014-06-14 07:44:56 UTC
Right. Howver config.h still is included in the wrong place, which can have undesired effects (e.g. when using largefiles, which isn't relevant for gterminal). 

So please commit, thanks!
Comment 9 Colin Walters 2014-06-14 14:08:55 UTC
Looks like this broke the Continuous build: http://build.gnome.org/continuous/buildmaster/builds/2014/06/14/16/build/log-gnome-terminal.txt
Comment 10 Egmont Koblinger 2014-06-14 16:21:19 UTC
Reverting for now.

Looks like it's vala bug 725995.  I can't reproduce with gcc, but can with clang.

I have no idea how to wor around the issue.  Let's hope vala folks fix it before gterminal becomes mature :)
Comment 11 Egmont Koblinger 2014-06-14 20:37:55 UTC
Created attachment 278460 [details] [review]
-Werror workaround

According to bug 725995 comment 2, this might be a suitable workaround.
Comment 12 Egmont Koblinger 2014-06-14 21:24:29 UTC
Colin: Could you please confirm that it's compiling in Continuous Build again?
Comment 13 Colin Walters 2014-06-14 22:27:44 UTC
(In reply to comment #12)
> Colin: Could you please confirm that it's compiling in Continuous Build again?

Feel free to try pushing a "git revert" of https://git.gnome.org/browse/gnome-continuous/commit/?id=a50cf3c91cb61f35d4eb25191ef21a02639833fe
Comment 14 Egmont Koblinger 2014-06-14 23:22:30 UTC
Build 20140614.29 succeeded, I think we're okay.