Re: [PATCH v2 00/11] Mark strings in perl script for translation
Junio C Hamano writes: > Vasco Almeida writes: > >> Mark messages in some perl scripts for translation. >> >> Since v1, adds brackets so parameter grouping of sprintf parameters is easier >> to see. >> >> Interdiff included below. > > Thanks; it is way too late for this cycle for i18n so I won't be > picking the series up right now. Please ping me if you see me > forget to pick it up in a week after 2.10 final gets tagged. I'll queue this round on 'pu' (if there aren't too heavy conflicts, that is) and let the interested parties continue reviewing and discussing. Thanks.
Re: [PATCH v2 00/11] Mark strings in perl script for translation
Vasco Almeida writes: > Mark messages in some perl scripts for translation. > > Since v1, adds brackets so parameter grouping of sprintf parameters is easier > to see. > > Interdiff included below. Thanks; it is way too late for this cycle for i18n so I won't be picking the series up right now. Please ping me if you see me forget to pick it up in a week after 2.10 final gets tagged.
[PATCH v2 00/11] Mark strings in perl script for translation
Mark messages in some perl scripts for translation. Since v1, adds brackets so parameter grouping of sprintf parameters is easier to see. Interdiff included below. Vasco Almeida (11): i18n: add--interactive: mark strings for translation i18n: add--interactive: mark simple here documents for translation i18n: add--interactive: mark strings with interpolation for translation i18n: add--interactive: mark plural strings i18n: add--interactive: mark message for translation i18n: add--interactive: i18n of help_patch_cmd i18n: add--interactive: mark edit_hunk_manually message for translation i18n: send-email: mark strings for translation i18n: send-email: mark warnings and errors for translation i18n: send-email: mark string with interpolation for translation i18n: difftool: mark warnings for translation Makefile | 3 +- git-add--interactive.perl | 358 ++ git-difftool.perl | 18 +-- git-send-email.perl | 160 +++-- perl/Git/I18N.pm | 4 +- t/t0202/test.pl | 11 +- 6 files changed, 376 insertions(+), 178 deletions(-) >8 diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 1652a57..235142c 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -614,12 +614,12 @@ sub list_and_choose { else { $bottom = $top = find_unique($choice, @stuff); if (!defined $bottom) { - error_msg sprintf __("Huh (%s)?\n"), $choice; + error_msg sprintf(__("Huh (%s)?\n"), $choice); next TOPLOOP; } } if ($opts->{SINGLETON} && $bottom != $top) { - error_msg sprintf __("Huh (%s)?\n"), $choice; + error_msg sprintf(__("Huh (%s)?\n"), $choice); next TOPLOOP; } for ($i = $bottom-1; $i <= $top-1; $i++) { @@ -669,17 +669,17 @@ sub say_n_paths { my $did = shift @_; my $cnt = scalar @_; if ($did eq 'added') { - printf Q__("added one path\n", "added %d paths\n", - $cnt), $cnt; + printf(Q__("added one path\n", "added %d paths\n", + $cnt), $cnt); } elsif ($did eq 'updated') { - printf Q__("updated one path\n", "updated %d paths\n", - $cnt), $cnt; + printf(Q__("updated one path\n", "updated %d paths\n", + $cnt), $cnt); } elsif ($did eq 'reversed') { - printf Q__("reversed one path\n", "reversed %d paths\n", - $cnt), $cnt; + printf(Q__("reversed one path\n", "reversed %d paths\n", + $cnt), $cnt); } else { - printf Q__("touched one path\n", "touched %d paths\n", - $cnt), $cnt; + printf(Q__("touched one path\n", "touched %d paths\n", + $cnt), $cnt); } } @@ -1056,12 +1056,12 @@ sub edit_hunk_manually { my $hunkfile = $repo->repo_path . "/addp-hunk-edit.diff"; my $fh; open $fh, '>', $hunkfile - or die sprintf __("failed to open hunk edit file for writing: %s"), $!; + or die sprintf(__("failed to open hunk edit file for writing: %s"), $!); print $fh __("# Manual hunk edit mode -- see bottom for a quick guide\n"); print $fh @$oldtext; my $is_reverse = $patch_mode_flavour{IS_REVERSE}; my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-'); - print $fh (sprintf __( + print $fh sprintf(__( "# --- # To remove '%s' lines, make them ' ' lines (context). # To remove '%s' lines, delete them. @@ -1121,7 +1121,7 @@ sub edit_hunk_manually { } open $fh, '<', $hunkfile - or die sprintf __("failed to open hunk edit file for reading: %s"), $!; + or die sprintf(__("failed to open hunk edit file for reading: %s"), $!); my @newtext = grep { !/^#/ } <$fh>; close $fh; unlink $hunkfile; @@ -1314,7 +1314,7 @@ sub apply_patch_for_checkout_commit { sub patch_update_cmd { my @all_mods = list_modified($patch_mode_flavour{FILTER}); - error_msg sprintf __("ignoring unmerged: %s\n"), $_->{VALUE} + error_msg sprintf(__("ignoring unmerged: %s\n"), $_->{VALUE}) for grep { $_->{UNMERGED} } @all_mods; @all_mods = grep { !$_->{UNMERGED} } @all_mods; @@ -1458,100 +1458,79 @@ sub patch_update_file { if ($patch_mode eq 'stage') { if ($hunk[$ix]
[PATCH v2 00/11] Mark strings in perl script for translation
Mark messages in some perl scripts for translation. Since v1, adds brackets so parameter grouping of sprintf parameters is easier to see. Interdiff included below. Vasco Almeida (11): i18n: add--interactive: mark strings for translation i18n: add--interactive: mark simple here documents for translation i18n: add--interactive: mark strings with interpolation for translation i18n: add--interactive: mark plural strings i18n: add--interactive: mark message for translation i18n: add--interactive: i18n of help_patch_cmd i18n: add--interactive: mark edit_hunk_manually message for translation i18n: send-email: mark strings for translation i18n: send-email: mark warnings and errors for translation i18n: send-email: mark string with interpolation for translation i18n: difftool: mark warnings for translation Makefile | 3 +- git-add--interactive.perl | 358 ++ git-difftool.perl | 18 +-- git-send-email.perl | 160 +++-- perl/Git/I18N.pm | 4 +- t/t0202/test.pl | 11 +- 6 files changed, 376 insertions(+), 178 deletions(-) >8 diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 1652a57..235142c 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -614,12 +614,12 @@ sub list_and_choose { else { $bottom = $top = find_unique($choice, @stuff); if (!defined $bottom) { - error_msg sprintf __("Huh (%s)?\n"), $choice; + error_msg sprintf(__("Huh (%s)?\n"), $choice); next TOPLOOP; } } if ($opts->{SINGLETON} && $bottom != $top) { - error_msg sprintf __("Huh (%s)?\n"), $choice; + error_msg sprintf(__("Huh (%s)?\n"), $choice); next TOPLOOP; } for ($i = $bottom-1; $i <= $top-1; $i++) { @@ -669,17 +669,17 @@ sub say_n_paths { my $did = shift @_; my $cnt = scalar @_; if ($did eq 'added') { - printf Q__("added one path\n", "added %d paths\n", - $cnt), $cnt; + printf(Q__("added one path\n", "added %d paths\n", + $cnt), $cnt); } elsif ($did eq 'updated') { - printf Q__("updated one path\n", "updated %d paths\n", - $cnt), $cnt; + printf(Q__("updated one path\n", "updated %d paths\n", + $cnt), $cnt); } elsif ($did eq 'reversed') { - printf Q__("reversed one path\n", "reversed %d paths\n", - $cnt), $cnt; + printf(Q__("reversed one path\n", "reversed %d paths\n", + $cnt), $cnt); } else { - printf Q__("touched one path\n", "touched %d paths\n", - $cnt), $cnt; + printf(Q__("touched one path\n", "touched %d paths\n", + $cnt), $cnt); } } @@ -1056,12 +1056,12 @@ sub edit_hunk_manually { my $hunkfile = $repo->repo_path . "/addp-hunk-edit.diff"; my $fh; open $fh, '>', $hunkfile - or die sprintf __("failed to open hunk edit file for writing: %s"), $!; + or die sprintf(__("failed to open hunk edit file for writing: %s"), $!); print $fh __("# Manual hunk edit mode -- see bottom for a quick guide\n"); print $fh @$oldtext; my $is_reverse = $patch_mode_flavour{IS_REVERSE}; my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-'); - print $fh (sprintf __( + print $fh sprintf(__( "# --- # To remove '%s' lines, make them ' ' lines (context). # To remove '%s' lines, delete them. @@ -1121,7 +1121,7 @@ sub edit_hunk_manually { } open $fh, '<', $hunkfile - or die sprintf __("failed to open hunk edit file for reading: %s"), $!; + or die sprintf(__("failed to open hunk edit file for reading: %s"), $!); my @newtext = grep { !/^#/ } <$fh>; close $fh; unlink $hunkfile; @@ -1314,7 +1314,7 @@ sub apply_patch_for_checkout_commit { sub patch_update_cmd { my @all_mods = list_modified($patch_mode_flavour{FILTER}); - error_msg sprintf __("ignoring unmerged: %s\n"), $_->{VALUE} + error_msg sprintf(__("ignoring unmerged: %s\n"), $_->{VALUE}) for grep { $_->{UNMERGED} } @all_mods; @all_mods = grep { !$_->{UNMERGED} } @all_mods; @@ -1458,100 +1458,79 @@ sub patch_update_file { if ($patch_mode eq 'stage') { if ($hunk[$ix]