This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=29a5093b8b5b6850bff0bfe07daa810e4b4a3c30 commit 29a5093b8b5b6850bff0bfe07daa810e4b4a3c30 Author: Guillem Jover <[email protected]> AuthorDate: Thu Nov 24 03:17:53 2022 +0100 Dpkg::Gettext: Add new gettext compatibility stub We are calling gettext() from various places, but we might not have Locale::gettext available. --- debian/copyright | 2 +- scripts/Dpkg/Gettext.pm | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/debian/copyright b/debian/copyright index ab3ae7462..ba943ac18 100644 --- a/debian/copyright +++ b/debian/copyright @@ -75,7 +75,7 @@ Files: scripts/Dpkg/Gettext.pm Copyright: Copyright © 2000 Joey Hess <[email protected]> - Copyright © 2007, 2009-2010, 2012-2015 Guillem Jover <[email protected]> + Copyright © 2007-2022 Guillem Jover <[email protected]> License: BSD-2-clause Files: diff --git a/scripts/Dpkg/Gettext.pm b/scripts/Dpkg/Gettext.pm index f719a6291..bac8f57cb 100644 --- a/scripts/Dpkg/Gettext.pm +++ b/scripts/Dpkg/Gettext.pm @@ -1,7 +1,7 @@ # Copied from /usr/share/perl5/Debconf/Gettext.pm # # Copyright © 2000 Joey Hess <[email protected]> -# Copyright © 2007, 2009-2010, 2012-2017 Guillem Jover <[email protected]> +# Copyright © 2007-2022 Guillem Jover <[email protected]> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -30,9 +30,10 @@ use strict; use warnings; use feature qw(state); -our $VERSION = '2.00'; +our $VERSION = '2.01'; our @EXPORT = qw( textdomain + gettext ngettext g_ P_ @@ -95,6 +96,12 @@ Compatibility textdomain() fallback when Locale::gettext is not available. If $new_domain is not undef, it will set the current domain to $new_domain. Returns the current domain, after possibly changing it. +=item $trans = gettext($msgid) + +Compatibility gettext() fallback when Locale::gettext is not available. + +Returns $msgid. + =item $trans = ngettext($msgid, $msgid_plural, $n) Compatibility ngettext() fallback when Locale::gettext is not available. @@ -142,6 +149,10 @@ BEGIN { return $domain; }; + *gettext = sub { + my $msgid = shift; + return $msgid; + }; *ngettext = sub { my ($msgid, $msgid_plural, $n) = @_; if ($n == 1) { @@ -190,6 +201,10 @@ sub N_ =head1 CHANGES +=head2 Version 2.01 (dpkg 1.21.10) + +New function: gettext(). + =head2 Version 2.00 (dpkg 1.20.0) Remove function: _g(). -- Dpkg.Org's dpkg

