X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=Debian%2FDgit%2FI18n.pm;h=e8068ff366bcb4e3170c85e05073addef87c885e;hb=HEAD;hp=b86fec8d3596f4a3db7864d2e5693eb9d2a50698;hpb=33f697e1ebf2ca4a68479c7769ecc93dd0ee28e3;p=dgit.git diff --git a/Debian/Dgit/I18n.pm b/Debian/Dgit/I18n.pm index b86fec8d..e8068ff3 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 f_ { my $f = shift @_; sprintf +(gettext $f), @_; } +sub __ ($) { gettext @_; } +sub i_ ($) { $_[0]; } +sub f_ ($$;@) { my $f = shift @_; sprintf +(gettext $f), @_; } 1;