summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-09-29 13:02:51 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-09-30 01:51:09 +0100
commitf267017422adea03967b5cf66426e4229c3ff46b (patch)
tree0fec6d97ea93891edc45affd8cafe48c9b9987fa /Debian
parent1e8530a75b48e9444c3f629eea2e1414e001b76c (diff)
i18n: Provide i_ (identity function, tags for translation)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Dgit/I18n.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/Debian/Dgit/I18n.pm b/Debian/Dgit/I18n.pm
index 9c474ee..e8068ff 100644
--- a/Debian/Dgit/I18n.pm
+++ b/Debian/Dgit/I18n.pm
@@ -5,6 +5,7 @@ package Debian::Dgit::I18n;
# This module provides
# __ a function which is an alias for gettext
# f_ sprintf wrapper that gettexts the format
+# i_ identify function, but marks string for translation
#
# In perl the sub `_' is a `superglobal', which means there
# is only one of it in the whole program and every reference
@@ -16,11 +17,12 @@ use Locale::gettext;
BEGIN {
use Exporter;
@ISA = qw(Exporter);
- @EXPORT = qw(__ f_);
+ @EXPORT = qw(__ f_ i_);
}
sub __ ($) { gettext @_; }
+sub i_ ($) { $_[0]; }
sub f_ ($$;@) { my $f = shift @_; sprintf +(gettext $f), @_; }
1;