{"thread":{"id":"10527","subject":"[GIT-GUI PATCH 0/3] po2msg fixes","startedAt":"2007-10-30T11:24:12Z","lastAt":"2007-10-31T02:23:16Z","messageCount":7,"participants":["Johannes Schindelin","Junio C Hamano","Christian Stimming"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"57563","messageId":"Pine.LNX.4.64.0710301122300.4362@racer.site","threadId":"10527","inReplyTo":null,"subject":"[GIT-GUI PATCH 0/3] po2msg fixes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-30T11:24:12Z","receivedAt":"2007-10-30T11:24:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nthis series of 3 patches fixes the following:\n\n- fuzzy translations are ignored\n- empty translations are ignored\n- the --statistics option is implemented\n\nCiao,\nDscho\n"},{"id":"57564","messageId":"Pine.LNX.4.64.0710301124220.4362@racer.site","threadId":"10527","inReplyTo":"Pine.LNX.4.64.0710301122300.4362@racer.site","subject":"[GIT-GUI PATCH 1/3] po2msg: ignore entries marked with \"fuzzy\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-30T11:24:37Z","receivedAt":"2007-10-30T11:24:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nAs Christian Stimming pointed out, entries which are \"fuzzy\" need to\nbe checked by human translators, and cannot be used.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n po/po2msg.sh |   13 +++++++++++--\n 1 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/po/po2msg.sh b/po/po2msg.sh\nindex da0765d..48a2669 100644\n--- a/po/po2msg.sh\n+++ b/po/po2msg.sh\n@@ -48,12 +48,16 @@ for {set i 1} {$i < $argc} {incr i} {\n }\n \n proc flush_msg {} {\n-\tglobal msgid msgstr mode lang out\n+\tglobal msgid msgstr mode lang out fuzzy\n \n \tif {![info exists msgid] || $mode == \"\"} {\n \t\treturn\n \t}\n \tset mode \"\"\n+\tif {$fuzzy == 1} {\n+\t\tset fuzzy 0\n+\t\treturn\n+\t}\n \n \tif {$msgid == \"\"} {\n \t\tset prefix \"set ::msgcat::header\"\n@@ -64,6 +68,7 @@ proc flush_msg {} {\n \tputs $out \"$prefix \\\"[u2a $msgstr]\\\"\"\n }\n \n+set fuzzy 0\n foreach file $files {\n \tregsub \"^.*/\\(\\[^/\\]*\\)\\.po$\" $file \"$output_directory\\\\1.msg\" outfile\n \tset in [open $file \"r\"]\n@@ -73,7 +78,11 @@ foreach file $files {\n \tset mode \"\"\n \twhile {[gets $in line] >= 0} {\n \t\tif {[regexp \"^#\" $line]} {\n-\t\t\tflush_msg\n+\t\t\tif {[regexp \", fuzzy\" $line]} {\n+\t\t\t\tset fuzzy 1\n+\t\t\t} else {\n+\t\t\t\tflush_msg\n+\t\t\t}\n \t\t\tcontinue\n \t\t} elseif {[regexp \"^msgid \\\"(.*)\\\"$\" $line dummy match]} {\n \t\t\tflush_msg\n-- \n1.5.3.4.1423.g7c7a7\n"},{"id":"57565","messageId":"Pine.LNX.4.64.0710301124450.4362@racer.site","threadId":"10527","inReplyTo":"Pine.LNX.4.64.0710301122300.4362@racer.site","subject":"[GIT-GUI PATCH 2/3] po2msg: ignore untranslated messages","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-30T11:24:53Z","receivedAt":"2007-10-30T11:24:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nDo not generate translations when the translated message is empty.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n po/po2msg.sh |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/po/po2msg.sh b/po/po2msg.sh\nindex 48a2669..91d420b 100644\n--- a/po/po2msg.sh\n+++ b/po/po2msg.sh\n@@ -62,6 +62,9 @@ proc flush_msg {} {\n \tif {$msgid == \"\"} {\n \t\tset prefix \"set ::msgcat::header\"\n \t} else {\n+\t\tif {$msgstr == \"\"} {\n+\t\t\treturn\n+\t\t}\n \t\tset prefix \"::msgcat::mcset $lang \\\"[u2a $msgid]\\\"\"\n \t}\n \n-- \n1.5.3.4.1423.g7c7a7\n"},{"id":"57566","messageId":"Pine.LNX.4.64.0710301124590.4362@racer.site","threadId":"10527","inReplyTo":"Pine.LNX.4.64.0710301122300.4362@racer.site","subject":"[GIT-GUI PATCH 3/3] po2msg: actually output statistics","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-30T11:25:31Z","receivedAt":"2007-10-30T11:25:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe \"--statistics\" option was ignored so far; no longer.  Now we have\na message similar to that of msgfmt.  (Untranslated, though ;-)\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n po/po2msg.sh |   23 +++++++++++++++++++++--\n 1 files changed, 21 insertions(+), 2 deletions(-)\n\ndiff --git a/po/po2msg.sh b/po/po2msg.sh\nindex 91d420b..78e49cc 100644\n--- a/po/po2msg.sh\n+++ b/po/po2msg.sh\n@@ -26,11 +26,17 @@ proc u2a {s} {\n set output_directory \".\"\n set lang \"dummy\"\n set files [list]\n+set show_statistics 0\n \n # parse options\n-for {set i 1} {$i < $argc} {incr i} {\n+for {set i 0} {$i < $argc} {incr i} {\n \tset arg [lindex $argv $i]\n-\tif {$arg == \"--statistics\" || $arg == \"--tcl\"} {\n+\tif {$arg == \"--statistics\"} {\n+\t\tincr show_statistics\n+\t\tcontinue\n+\t}\n+\tif {$arg == \"--tcl\"} {\n+\t\t# we know\n \t\tcontinue\n \t}\n \tif {$arg == \"-l\"} {\n@@ -49,12 +55,14 @@ for {set i 1} {$i < $argc} {incr i} {\n \n proc flush_msg {} {\n \tglobal msgid msgstr mode lang out fuzzy\n+\tglobal translated_count fuzzy_count not_translated_count\n \n \tif {![info exists msgid] || $mode == \"\"} {\n \t\treturn\n \t}\n \tset mode \"\"\n \tif {$fuzzy == 1} {\n+\t\tincr fuzzy_count\n \t\tset fuzzy 0\n \t\treturn\n \t}\n@@ -63,15 +71,20 @@ proc flush_msg {} {\n \t\tset prefix \"set ::msgcat::header\"\n \t} else {\n \t\tif {$msgstr == \"\"} {\n+\t\t\tincr not_translated_count\n \t\t\treturn\n \t\t}\n \t\tset prefix \"::msgcat::mcset $lang \\\"[u2a $msgid]\\\"\"\n+\t\tincr translated_count\n \t}\n \n \tputs $out \"$prefix \\\"[u2a $msgstr]\\\"\"\n }\n \n set fuzzy 0\n+set translated_count 0\n+set fuzzy_count 0\n+set not_translated_count 0\n foreach file $files {\n \tregsub \"^.*/\\(\\[^/\\]*\\)\\.po$\" $file \"$output_directory\\\\1.msg\" outfile\n \tset in [open $file \"r\"]\n@@ -113,3 +126,9 @@ foreach file $files {\n \tclose $out\n }\n \n+puts $show_statistics\n+if {$show_statistics} {\n+\tputs [concat \"$translated_count translated messages, \" \\\n+\t\t\"$fuzzy_count fuzzy ones, \" \\\n+\t\t\"$not_translated_count untranslated ones.\"]\n+}\n-- \n1.5.3.4.1423.g7c7a7\n"},{"id":"57602","messageId":"7vabq0l7wn.fsf@gitster.siamese.dyndns.org","threadId":"10527","inReplyTo":"Pine.LNX.4.64.0710301124450.4362@racer.site","subject":"Re: [GIT-GUI PATCH 2/3] po2msg: ignore untranslated messages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-10-30T19:27:52Z","receivedAt":"2007-10-30T19:27:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Do not generate translations when the translated message is empty.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  po/po2msg.sh |    3 +++\n>  1 files changed, 3 insertions(+), 0 deletions(-)\n>\n> diff --git a/po/po2msg.sh b/po/po2msg.sh\n> index 48a2669..91d420b 100644\n> --- a/po/po2msg.sh\n> +++ b/po/po2msg.sh\n> @@ -62,6 +62,9 @@ proc flush_msg {} {\n>  \tif {$msgid == \"\"} {\n>  \t\tset prefix \"set ::msgcat::header\"\n>  \t} else {\n> +\t\tif {$msgstr == \"\"} {\n> +\t\t\treturn\n> +\t\t}\n>  \t\tset prefix \"::msgcat::mcset $lang \\\"[u2a $msgid]\\\"\"\n>  \t}\n\nIs this change to fix some real issues?\n\nSometimes it is handy to be able to translate a non-empty string\ninto an empty one in one target language.\n"},{"id":"57619","messageId":"200710302144.39149.stimming@tuhh.de","threadId":"10527","inReplyTo":"7vabq0l7wn.fsf@gitster.siamese.dyndns.org","subject":"Re: [GIT-GUI PATCH 2/3] po2msg: ignore untranslated messages","fromName":"Christian Stimming","fromEmail":"stimming@tuhh.de","sentAt":"2007-10-30T20:44:38Z","receivedAt":"2007-10-30T20:44:38Z","isPatch":true,"sender":{"key":"stimming@tuhh.de","avatar":"https://avatars.githubusercontent.com/u/227778?v=4"},"body":"Am Dienstag, 30. Oktober 2007 20:27 schrieb Junio C Hamano:\n> > Do not generate translations when the translated message is empty.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  po/po2msg.sh |    3 +++\n> >  1 files changed, 3 insertions(+), 0 deletions(-)\n> >\n> > diff --git a/po/po2msg.sh b/po/po2msg.sh\n> > index 48a2669..91d420b 100644\n> > --- a/po/po2msg.sh\n> > +++ b/po/po2msg.sh\n> > @@ -62,6 +62,9 @@ proc flush_msg {} {\n> >  \tif {$msgid == \"\"} {\n> >  \t\tset prefix \"set ::msgcat::header\"\n> >  \t} else {\n> > +\t\tif {$msgstr == \"\"} {\n> > +\t\t\treturn\n> > +\t\t}\n> >  \t\tset prefix \"::msgcat::mcset $lang \\\"[u2a $msgid]\\\"\"\n> >  \t}\n>\n> Is this change to fix some real issues?\n\nI don't think to - it just makes the resulting foo.msg file smaller.\n\n> Sometimes it is handy to be able to translate a non-empty string\n> into an empty one in one target language.\n\nErr... no, this is not the case. The semantics of an msgstr == \"\" is identical \nto saying \"No translation exists to this source string\".  Nothing more, \nnothing less. You can't specify a translation that should map a given string \nto an empty string. (If you make up a case when that would make some sense, \nusually the source string is rather weirdly chosen and should be reworded.)\n\nChristian\n"},{"id":"57647","messageId":"Pine.LNX.4.64.0710310222110.4362@racer.site","threadId":"10527","inReplyTo":"7vabq0l7wn.fsf@gitster.siamese.dyndns.org","subject":"Re: [GIT-GUI PATCH 2/3] po2msg: ignore untranslated messages","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-31T02:23:16Z","receivedAt":"2007-10-31T02:23:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 30 Oct 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Do not generate translations when the translated message is empty.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  po/po2msg.sh |    3 +++\n> >  1 files changed, 3 insertions(+), 0 deletions(-)\n> >\n> > diff --git a/po/po2msg.sh b/po/po2msg.sh\n> > index 48a2669..91d420b 100644\n> > --- a/po/po2msg.sh\n> > +++ b/po/po2msg.sh\n> > @@ -62,6 +62,9 @@ proc flush_msg {} {\n> >  \tif {$msgid == \"\"} {\n> >  \t\tset prefix \"set ::msgcat::header\"\n> >  \t} else {\n> > +\t\tif {$msgstr == \"\"} {\n> > +\t\t\treturn\n> > +\t\t}\n> >  \t\tset prefix \"::msgcat::mcset $lang \\\"[u2a $msgid]\\\"\"\n> >  \t}\n> \n> Is this change to fix some real issues?\n\nYes.  I compared the output of po2msg.sh with that of msgfmt, and only \nwith this change (and 1/3) they came up identical.\n\nCiao,\nDscho\n"}]}