libintl-perl
view release on metacpan or search on metacpan
in "perldoc perllocale" if you have problems.
If, for example, the locale "fr_FR" is available on your system, set
the environment variable LANG to that value, for a POSIX shell
LANG=fr_FR
export LANG
for the C shell
setenv LANG fr_FR
and run your little Perl script. It should tell you what the error
message for "No such file or directory" is in French, or whatever
language you chose. Not a real example, because we have "stolen" a
message from a system catalog. But it should give you the general
idea, especially if you are already familiar with gettext in C.
If you still see the English message, this does not necessarily mean a
failure, since the string is maybe not translated on your system (try
"locate libc.mo" to get a list of available translations). Even for
in "perldoc perllocale" if you have problems.
If, for example, the locale "fr_FR" is available on your system, set
the environment variable LANG to that value, for a POSIX shell
LANG=fr_FR
export LANG
for the C shell
setenv LANG fr_FR
and run your little Perl script. It should tell you what the error
message for "No such file or directory" is in French, or whatever
language you chose. Not a real example, because we have "stolen" a
message from a system catalog. But it should give you the general
idea, especially if you are already familiar with gettext in C.
If you still see the English message, this does not necessarily mean a
failure, since the string is maybe not translated on your system (try
"locate libc.mo" to get a list of available translations). Even for
( run in 0.416 second using v1.01-cache-2.11-cpan-a1d94b6210f )