info > Locale::gettext

Not found locally for Locale::gettext. Try Google search

📖 NAME

Locale::gettext - message handling functions

🚀 Quick Reference

Use CaseCommandDescription
Set locale for translationsetlocale(LC_MESSAGES, "");Initialise locale for message retrieval
Create domain objectmy $d = Locale::gettext->domain("my_program");Create OO interface for a domain
Get translated string$d->get("Welcome");Retrieve translation for a message ID
Get plural translation$d->nget("one", "%d", $n);Retrieve singular/plural form
Set current text domaintextdomain("my_program");Switch to a domain for direct calls
Set message directorybindtextdomain("my_program", "/path");Specify where .mo files are stored

📝 SYNOPSIS

use Locale::gettext;
use POSIX;     # Needed for setlocale()

setlocale(LC_MESSAGES, "");

# OO interface
my $d = Locale::gettext->domain("my_program");

print $d->get("Welcome to my program"), "\n";
        # (printed in the local language)

# Direct access to C functions
textdomain("my_program");

print gettext("Welcome to my program"), "\n";
        # (printed in the local language)

📄 DESCRIPTION

The gettext module permits access from perl to the gettext() family of functions for retrieving message strings from databases constructed to internationalize software.

📦 Domain Object Methods

🔧 Direct Function Calls

📌 NOTES

Not all platforms provide all of the functions. Functions that are not available in the underlying C library will not be available in Perl either.

Perl programs should use the object interface. In addition to being able to return native Perl wide character strings, "bind_textdomain_codeset" will be emulated if the C library does not provide it.

📚 VERSION

1.07.

🔗 SEE ALSO

gettext(3i), gettext(1), msgfmt(1)

👤 AUTHOR

Kim Vandry <vandry AT TZoNE.ORG>

perl v5.34.0 2022-02-06 gettext(3pm)

Locale::gettext
📖 NAME 🚀 Quick Reference 📝 SYNOPSIS 📄 DESCRIPTION
📦 Domain Object Methods 🔧 Direct Function Calls
📌 NOTES 📚 VERSION 🔗 SEE ALSO 👤 AUTHOR

Generated by phpman v4.10.0-7-g98e9fd5 Author: Che Dong Under GNU General Public License
2026-09-09 11:42 @2600:1f28:365:80b0:60b0:dfa5:fbc9:9f8f
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!