X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=Debian%2FDgit%2FI18n.pm;fp=Debian%2FDgit%2FI18n.pm;h=c6f9e1663543b1cf201902c322cff2a00c962c73;hb=76876bd5a95c3ce1ff6ccf3f633a6cce6fa4e5b2;hp=0000000000000000000000000000000000000000;hpb=53d499e549e6eec5e319965cf2df1368120f2bca;p=dgit.git diff --git a/Debian/Dgit/I18n.pm b/Debian/Dgit/I18n.pm new file mode 100644 index 00000000..c6f9e166 --- /dev/null +++ b/Debian/Dgit/I18n.pm @@ -0,0 +1,26 @@ +# -*- perl -*- + +package Debian::Dgit::I18n; + +# This module provides +# __ a function which is an alias for gettext +# ___ sprintf wrapper that gettexts the format +# +# In perl the sub `_' is a `superglobal', which means there +# is only one of it in the whole program and every reference +# is to the same one. So it's not really useable in modules. +# Hence __. + +use Locale::gettext; + +BEGIN { + use Exporter; + @ISA = qw(Exporter); + @EXPORT = qw(__ ___); +} + + +sub __ { gettext @_; } +sub ___ { my $f = shift @_; sprintf +(gettext $f), @_; } + +1;