GNOME Bugzilla – Bug 329346
Makevars MSGID_BUGS_ADDRESS not honoured
Last modified: 2006-05-10 18:39:52 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.
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; +}
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.
Updating version to "0.34.x".
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.
I would prefer to see the code unified, rather than duplicating things every time a new feature like this is to be added.
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.
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
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. :)