From: Ian Jackson Date: Sat, 29 Sep 2018 10:00:22 +0000 (+0100) Subject: i18n: Rename ___ to f_ X-Git-Tag: archive/debian/7.0_pre1~75 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=33f697e1ebf2ca4a68479c7769ecc93dd0ee28e3 i18n: Rename ___ to f_ I have decided that's a better name. Not _f because, unlike printf (where f is done first, and then print), here the _ is done first and then f. Signed-off-by: Ian Jackson --- diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index b1aa6203..4b340d90 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -672,7 +672,7 @@ sub getfield ($$) { my ($dctrl,$field) = @_; my $v = $dctrl->{$field}; return $v if defined $v; - fail ___ "missing field %s in %s", $field, $dctrl->get_option('name'); + fail f_ "missing field %s in %s", $field, $dctrl->get_option('name'); } sub parsechangelog_loop ($$$) { diff --git a/Debian/Dgit/I18n.pm b/Debian/Dgit/I18n.pm index c6f9e166..b86fec8d 100644 --- a/Debian/Dgit/I18n.pm +++ b/Debian/Dgit/I18n.pm @@ -4,7 +4,7 @@ package Debian::Dgit::I18n; # This module provides # __ a function which is an alias for gettext -# ___ sprintf wrapper that gettexts the format +# f_ 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 @@ -16,11 +16,11 @@ use Locale::gettext; BEGIN { use Exporter; @ISA = qw(Exporter); - @EXPORT = qw(__ ___); + @EXPORT = qw(__ f_); } sub __ { gettext @_; } -sub ___ { my $f = shift @_; sprintf +(gettext $f), @_; } +sub f_ { my $f = shift @_; sprintf +(gettext $f), @_; } 1; diff --git a/dgit b/dgit index 238d3248..1877e03e 100755 --- a/dgit +++ b/dgit @@ -1474,7 +1474,7 @@ sub madison_get_parse { sub canonicalise_suite_madison { # madison canonicalises for us my @r = madison_get_parse(@_); - @r or fail ___ + @r or fail f_ "unable to canonicalise suite using package %s". " which does not appear to exist in suite %s;". " --existing-package may help", diff --git a/git-debrebase b/git-debrebase index 4a3ed25a..645b072a 100755 --- a/git-debrebase +++ b/git-debrebase @@ -3008,7 +3008,7 @@ if (!@ARGV || $opt_defaultcmd_interactive || $ARGV[0] =~ m{^-}) { $cmdfn =~ y/-/_/; $cmdfn = ${*::}{"cmd_$cmdfn"}; - $cmdfn or badusage ___ "unknown git-debrebase sub-operation %s", $cmd; + $cmdfn or badusage f_ "unknown git-debrebase sub-operation %s", $cmd; $cmdfn->(); } diff --git a/po/Makefile b/po/Makefile index 4e043eb3..2ba5e607 100644 --- a/po/Makefile +++ b/po/Makefile @@ -84,7 +84,7 @@ messages.pot: $(if $(SUPPRESS_PO_UPDATE),,$(POTS)) %.mo: %.po $S msgfmt -o $@ $< -XGETTEXT_OPTS += -Lperl -k__ -k___ +XGETTEXT_OPTS += -Lperl -k__ -kf_ 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'