From 55aa04423f14df3099466dc7eea4ca2d027b7d4c Mon Sep 17 00:00:00 2001 From: Vasco Almeida Date: Wed, 14 Dec 2016 11:54:34 -0100 Subject: i18n: add--interactive: mark status words for translation Mark words 'nothing', 'unchanged' and 'binary' used to display what has been staged or not, in "git add -i" status command. Alternatively one could mark N__('nothing') no-op in order to xgettext(1) extract the string and then trigger the translation at run time only with __($print->{FILE}), but that has the side effect of triggering retrieval of translations for the changes indicator too (e.g. +2/-1) which may or may not be a problem. To avoid that potential problem, mark only where there is certain to trigger translation only of those words but in this case we must also retrieve the translation for the eq tests, since the value assigned was of the translation, not the English source. Signed-off-by: Vasco Almeida Signed-off-by: Junio C Hamano --- git-add--interactive.perl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'git-add--interactive.perl') diff --git a/git-add--interactive.perl b/git-add--interactive.perl index d6d627fee..46dfc5276 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -294,7 +294,7 @@ sub list_modified { my ($change, $bin); $file = unquote_path($file); if ($add eq '-' && $del eq '-') { - $change = 'binary'; + $change = __('binary'); $bin = 1; } else { @@ -303,7 +303,7 @@ sub list_modified { $data{$file} = { INDEX => $change, BINARY => $bin, - FILE => 'nothing', + FILE => __('nothing'), } } elsif (($adddel, $file) = @@ -319,7 +319,7 @@ sub list_modified { $file = unquote_path($file); my ($change, $bin); if ($add eq '-' && $del eq '-') { - $change = 'binary'; + $change = __('binary'); $bin = 1; } else { @@ -339,7 +339,7 @@ sub list_modified { $file = unquote_path($2); if (!exists $data{$file}) { $data{$file} = +{ - INDEX => 'unchanged', + INDEX => __('unchanged'), BINARY => 0, }; } @@ -354,10 +354,10 @@ sub list_modified { if ($only) { if ($only eq 'index-only') { - next if ($it->{INDEX} eq 'unchanged'); + next if ($it->{INDEX} eq __('unchanged')); } if ($only eq 'file-only') { - next if ($it->{FILE} eq 'nothing'); + next if ($it->{FILE} eq __('nothing')); } } push @return, +{ -- cgit v1.2.1