Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
# 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
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;
%.mo: %.po
$S msgfmt -o $@ $<
-XGETTEXT_OPTS += -Lperl -k__ -kf_
+XGETTEXT_OPTS += -Lperl -k__ -kf_ -ki_
XGETTEXT_OPTS += --from-code=UTF-8
XGETTEXT_OPTS += --package-name=dgit --package-version=ongoing
# The --package-* avoids this error from make check's `msgfmt -c'