[Reproducible-commits] [dpkg] 45/61: Dpkg::Gettext: Add new function N_

Jérémy Bobbio lunar at moszumanska.debian.org
Mon Sep 21 09:57:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 9a54c92f8b09bf2b267b34542ed907a6fa791e09
Author: Guillem Jover <guillem at debian.org>
Date:   Thu Sep 17 18:01:37 2015 +0200

    Dpkg::Gettext: Add new function N_
---
 debian/copyright        |  1 +
 scripts/Dpkg/Gettext.pm | 28 +++++++++++++++++++++++++---
 scripts/po/Makevars     |  3 ++-
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/debian/copyright b/debian/copyright
index 84c4d5a..e47dd8d 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -65,6 +65,7 @@ Files:
  scripts/Dpkg/Gettext.pm
 Copyright:
  Copyright © 2000 Joey Hess <joeyh at debian.org>
+ Copyright © 2007, 2009-2010, 2012-2015 Guillem Jover <guillem at debian.org>
 License: BSD-2-clause
 
 Files:
diff --git a/scripts/Dpkg/Gettext.pm b/scripts/Dpkg/Gettext.pm
index b1f78b3..850162e 100644
--- a/scripts/Dpkg/Gettext.pm
+++ b/scripts/Dpkg/Gettext.pm
@@ -1,5 +1,8 @@
 # Copied from /usr/share/perl5/Debconf/Gettext.pm
 #
+# Copyright © 2000 Joey Hess <joeyh at debian.org>
+# Copyright © 2007, 2009-2010, 2012-2015 Guillem Jover <guillem at debian.org>
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
 # are met:
@@ -26,12 +29,13 @@ package Dpkg::Gettext;
 use strict;
 use warnings;
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 our @EXPORT = qw(
     textdomain
     ngettext
     g_
     P_
+    N_
     _g
 );
 
@@ -89,8 +93,6 @@ Calls dngettext(), returning the correct translation for the plural form
 dependent on $n. If dngettext() is not available, returns $msgid if $n is 1
 or $msgid_plural otherwise.
 
-=back
-
 =cut
 
 use constant GETTEXT_CONTEXT_GLUE => "\004";
@@ -137,6 +139,22 @@ BEGIN {
     }
 }
 
+=item $msgid = N_($msgid)
+
+A pseudo function that servers as a marked for automated extraction of
+messages, but does not call gettext(). The run-time translation is done
+at a different place in the code.
+
+=back
+
+=cut
+
+sub N_
+{
+    my $msgid = shift;
+    return $msgid;
+}
+
 # XXX: Backwards compatibility, to be removed on VERSION 2.00.
 sub _g ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
 {
@@ -150,6 +168,10 @@ sub _g ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
 
 =head1 CHANGES
 
+=head2 Version 1.02 (dpkg 1.18.3)
+
+New function: N_().
+
 =head2 Version 1.01 (dpkg 1.18.0)
 
 Now the short aliases (g_ and P_) will call domain aware functions with
diff --git a/scripts/po/Makevars b/scripts/po/Makevars
index 6d00c34..db488d4 100644
--- a/scripts/po/Makevars
+++ b/scripts/po/Makevars
@@ -9,7 +9,8 @@ top_builddir = ../..
 
 # These options get passed to xgettext.
 XGETTEXT_OPTIONS = --from-code=UTF-8 --add-location=file \
-                   --keyword --keyword=g_ --keyword=P_:1,2
+                   --keyword --keyword=g_ --keyword=N_ \
+                   --keyword=P_:1,2 --keyword=C_:1c,2
 
 # This is the copyright holder that gets inserted into the header of the
 # $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list