Dpkg::Gettext(3perl)
π Dpkg::Gettext(3perl) π
okay bestie, welcome to the Dpkg::Gettext(3perl) page β it's giving tiny helper module with main-character energy, and honestly? We love her. π
β¨ NAME β¨
Dpkg::Gettext β a convenience wrapper around Locale::gettext. That's the whole vibe. π
πΈ DESCRIPTION πΈ
okay so the Dpkg::Gettext module is a convenience wrapper over the Locale::gettext module. Its whole job is to guarantee we always have working gettext functions, and to add some commonly used aliases. No cap, it's literally just here to make gettext life easier. β¨
π ENVIRONMENT π
DPKG_NLSβ when set to0, this environment variable disables National Language Support in all Dpkg modules. So yeah, zero means NLS off everywhere in Dpkg-land. π«Ά
π VARIABLES π
$Dpkg::Gettext::DEFAULT_TEXT_DOMAINβ specifies the default text domain name to be used with the short function aliases. It's intended to be used by the Dpkg modules, so they can produce localized messages even when the calling program has set the current domain withtextdomain(). If you'd like to use the aliases for your own modules, you might want to set this variable toundef, or to another domain β but then the Dpkg modules will not produce localized messages. Lowkey important, so don't skip this part. π¦
π FUNCTIONS π
$domain = textdomain($new_domain)β compatibilitytextdomain()fallback for whenLocale::gettextis not available. If$new_domainis notundef, it sets the current domain to$new_domain. Returns the current domain, after possibly changing it. πΈ$trans = gettext($msgid)β compatibilitygettext()fallback for whenLocale::gettextis not available. Returns$msgid. Simple, iconic, done. β¨$trans = ngettext($msgid, $msgid_plural, $n)β compatibilityngettext()fallback for whenLocale::gettextis not available. Returns$msgidif$nis1, or$msgid_pluralotherwise. Plural vibes handled. π$trans = g_($msgid)β callsdgettext()on the$msgidand returns its translation for the current locale. Ifdgettext()is not available, returns$msgid. π$trans = C_($msgctxt, $msgid)β callsdgettext()on the$msgidand returns its translation for the specific$msgctxtsupplied. Ifdgettext()is not available, returns$msgid. Context girlies rise. π$trans = P_($msgid, $msgid_plural, $n)β callsdngettext(), returning the correct translation for the plural form dependent on$n. Ifdngettext()is not available, returns$msgidif$nis1, or$msgid_pluralotherwise. Plural form? Handled. π$msgid = N_($msgid)β a pseudo function that acts as a marker for automated extraction of messages, but does not callgettext(). The run-time translation is done at a different place in the code. It's a marker, not a translator β iykyk. π§
π¦ CHANGES π¦
πΈ Version 2.01 (dpkg 1.21.10) πΈ
- New function:
gettext(). β¨
π Version 2.00 (dpkg 1.20.0) π
- Remove function:
_g(). π
π Version 1.03 (dpkg 1.19.0) π
- New envvar: add support for the new
DPKG_NLSenvironment variable. π«Ά
π Version 1.02 (dpkg 1.18.3) π
- New function:
N_(). π
π Version 1.01 (dpkg 1.18.0) π
- Now the short aliases (
g_andP_) will call domain aware functions with$DEFAULT_TEXT_DOMAIN. - New functions:
g_(),C_(). - Deprecated function:
_g(). π₯²
β Version 1.00 (dpkg 1.15.6) β
- Mark the module as public. Periodt. π
xoxo bestie β this Dpkg::Gettext(3perl) page ships with libdpkg-perl version 1.23.11-dirty, dated 2026-09-09 ππ«Ά
π¦ where this page comes from
- arch rolling: dpkg 1.23.11-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms