chiark / gitweb /
i18n: Rename ___ to f_
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Sep 2018 10:00:22 +0000 (11:00 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Sep 2018 11:47:39 +0000 (12:47 +0100)
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 <ijackson@chiark.greenend.org.uk>
Debian/Dgit.pm
Debian/Dgit/I18n.pm
dgit
git-debrebase
po/Makefile

index b1aa620366daefb40079b287ea400c458dab42e2..4b340d90782855d0926e42b9bf169e93e047e6cb 100644 (file)
@@ -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 ($$$) {
index c6f9e1663543b1cf201902c322cff2a00c962c73..b86fec8d3596f4a3db7864d2e5693eb9d2a50698 100644 (file)
@@ -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 238d32485848599362e37b2603d3471242d6e074..1877e03ec5d317675aa1cc0980bdd7da65dcf76c 100755 (executable)
--- 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",
index 4a3ed25ac149233e71783f39f98ac209c8821fff..645b072aaf2a11eb34ca2943eb4b69961c49ed74 100755 (executable)
@@ -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->();
 }
 
index 4e043eb320c8079b26c2a892a9d94559b8a74193..2ba5e6078a20825e994a5e1c09498d5b88aa8b62 100644 (file)
@@ -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'