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 329346 - Makevars MSGID_BUGS_ADDRESS not honoured
Makevars MSGID_BUGS_ADDRESS not honoured
Status: RESOLVED FIXED
Product: intltool
Classification: Deprecated
Component: general
0.34.x
Other All
: Normal enhancement
: ---
Assigned To: intltool maintainers
intltool maintainers
Depends on:
Blocks:
 
 
Reported: 2006-01-31 13:16 UTC by Dwayne Bailey
Modified: 2006-05-10 18:39 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch to add msgid-bugs-address support to intltool (1.28 KB, patch)
2006-02-25 22:09 UTC, Simos Xenitellis
reviewed Details | Review

Description Dwayne Bailey 2006-01-31 13:16:09 UTC
The Makevars files can contain a MSGID_BUGS_ADDRESS which allows a contact
email/URL to be placed in the generated POT file.  Very useful for translators
needing info or correcting source string errors.
Comment 1 Dwayne Bailey 2006-01-31 13:26:32 UTC
Here is a patch.  Sorry buzilla was barfing when I tried to submit the proper way:

--- intltool-update.in  2006-01-31 15:17:02.000000000 +0200
+++ intltool-update.in.new      2006-01-31 14:56:21.000000000 +0200
@ -719,6 +719,8 @@
                           "--files-from\=\.\/POTFILES\.in\.temp");
     my $XGETTEXT_KEYWORDS = &FindPOTKeywords;
     push @xgettext_argument, $XGETTEXT_KEYWORDS;
+    my $MSGID_BUGS_ADDRESS = &FindMakevarsMsgidBugAddress;
+    push @xgettext_argument, "--msgid-bugs-address\=$MSGID_BUGS_ADDRESS";
     push @xgettext_argument, "--from-code\=$encoding" if ($gettext_support_nonascii);
     push @xgettext_argument, $XGETTEXT_ARGS if $XGETTEXT_ARGS;
     my $xgettext_command = join ' ', @xgettext_argument;
@@ -1061,3 +1063,23 @@

     return $domain;
 }
+
+sub FindMakevarsMsgidBugAddress
+{
+
+    my $msgidbugaddress = "";
+    my $makevars_source; {
+       local (*IN);
+       open (IN, "<Makevars") || return $msgidbugaddress;
+       seek (IN, 0, 0);
+       local $/; # slurp mode
+       $makevars_source = <IN>;
+       close IN;
+    }
+
+    $msgidbugaddress = $1 if $makevars_source =~ /^MSGID_BUGS_ADDRESS[ ]*=\[?([^\n\]\$]+)/m;
+    $msgidbugaddress =~ s/^\s+//;
+    $msgidbugaddress =~ s/\s+$//;
+
+    return $msgidbugaddress;
+}
Comment 2 Simos Xenitellis 2006-02-25 22:09:09 UTC
Created attachment 60128 [details] [review]
Patch to add msgid-bugs-address support to intltool

This is Dwayne's patch; I verify that it applies cleanly to GNOME HEAD.
Comment 3 Simos Xenitellis 2006-02-25 22:12:04 UTC
Updating version to "0.34.x".
Comment 4 Danilo Segan 2006-02-26 22:14:06 UTC
Damn, I was just going to respond with "try with latest version, we might have fixed it" when I saw Dwayne's post on translation-i18n list, but Simos ruined it for me :)

Anyway, I wonder if we also want to do variable substitution, and unify with very similar code we've got in FindMakevarsDomain.
Comment 5 Rodney Dawes 2006-02-27 02:55:52 UTC
I would prefer to see the code unified, rather than duplicating things every time a new feature like this is to be added.
Comment 6 Dwayne Bailey 2006-02-27 07:10:55 UTC
Thanks everyone for looking at this.

I agree that this should be unified (it made me shiver when I did it :).  I'm not a Perl hacker so if someone else can do that I'd appreciate it.
Comment 7 Clytie Siddall 2006-02-27 12:29:32 UTC
This capacity is _very_ important to translators. It is there so we can report msgid bugs/typos, and query ambiguous strings or individual terminology. Without this header, we waste a _lot_ of time chasing contact details through Google and around the web. In most cases, I think without this header, translators would simply give up. This results in lower-quality translations, and bugs/typos in the original strings not being fixed.

I strongly support this patch.

from Clytie, Vietnamese translator and (so far) persistent Typo-In-PO-File reporter
Comment 8 Rodney Dawes 2006-05-10 18:39:52 UTC
I've committed a modified version of this patch to CVS. I didn't feel like rewriting all of intltool-update right now, which is what would happen if I wanted to actually get the code cleaned up and merged to be somewhat more sane. Anyway, the changes consisted of only passing the option to xgettext if the bug address is actually found in Makevars, and a little shortening of the new method name, and the variables in the new method, to not hurt my eyes when reading the code. :)