@node gettext, integer, diagnostics, Module List
@unnumbered message handling functions


@unnumberedsec NAME

gettext - message handling functions

@unnumberedsec SYNOPSIS

@example
use gettext;
use POSIX;     # Needed for setlocale()
@end example

@example
setlocale(LC_MESSAGES, "");
textdomain("my_program");
@end example

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

@unnumberedsec DESCRIPTION

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

gettext(), dgettext(), and dcgettext() attempt to retrieve a string
matching their @code{msgid} parameter within the context of the current
locale. dcgettext() takes the message@'s category and the text domain
as parameters while dcgettext() defaults to the LC_MESSAGES category
and gettext() defaults to LC_MESSAGES and uses the current text domain.
If the string is not found in the database, then @code{msgid} is returned.

textdomain() sets the current text domain and returns the previously
active domain.

@emph{bindtextdomain(domain, dirname)} instructs the retrieval functions to look
for the databases belonging to domain domain in the directory
@code{dirname}

@unnumberedsec SEE ALSO

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

@unnumberedsec AUTHOR

Phillip Vandry <vandry@@Mlink.NET>
