summaryrefslogtreecommitdiff
path: root/t/t0202
diff options
context:
space:
mode:
authorLibravatar Vasco Almeida <vascomalmeida@sapo.pt>2016-12-14 11:54:30 -0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-12-14 11:00:05 -0800
commit0539d5e6d535760a99694ff5d5592e46ed929d15 (patch)
treef2f2dc021af40a4baa77333ae92472dfd10834d3 /t/t0202
parenti18n: add--interactive: mark plural strings (diff)
downloadtgif-0539d5e6d535760a99694ff5d5592e46ed929d15.tar.xz
i18n: add--interactive: mark patch prompt for translation
Mark prompt message assembled in place for translation, unfolding each use case for each entry in the %patch_modes hash table. Previously, this script relied on whether $patch_mode was set to run the command patch_update_cmd() or show status and loop the main loop. Now, it uses $cmd to indicate we must run patch_update_cmd() and $patch_mode is used to tell which flavor of the %patch_modes are we on. This is introduced in order to be able to mark and unfold the message prompt knowing in which context we are. The tracking of context was done previously by point %patch_mode_flavour hash table to the correct entry of %patch_modes, focusing only on value of %patch_modes. Now, we are also interested in the key ('staged', 'stash', 'checkout_head', ...). Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0202')
-rwxr-xr-xt/t0202/test.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/t0202/test.pl b/t/t0202/test.pl
index 4101833a8e..2cbf7b9590 100755
--- a/t/t0202/test.pl
+++ b/t/t0202/test.pl
@@ -4,7 +4,7 @@ use lib (split(/:/, $ENV{GITPERLLIB}));
use strict;
use warnings;
use POSIX qw(:locale_h);
-use Test::More tests => 11;
+use Test::More tests => 13;
use Git::I18N;
my $has_gettext_library = $Git::I18N::__HAS_LIBRARY;
@@ -32,6 +32,7 @@ is_deeply(\@Git::I18N::EXPORT, \@Git::I18N::EXPORT_OK, "sanity: Git::I18N export
my %prototypes = (qw(
__ $
__n $$$
+ N__ $
));
while (my ($sub, $proto) = each %prototypes) {
is(prototype(\&{"Git::I18N::$sub"}), $proto, "sanity: $sub has a $proto prototype");
@@ -55,6 +56,8 @@ is_deeply(\@Git::I18N::EXPORT, \@Git::I18N::EXPORT_OK, "sanity: Git::I18N export
"Get singular string through __n() in C locale");
is(__n($got_singular, $got_plural, 2), $expect_plural,
"Get plural string through __n() in C locale");
+
+ is(N__($got), $expect, "Passing a string through N__() in the C locale works");
}
# Test a basic message on different locales