Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xacobeo::i18n(3pm) [debian man page]

Xacobeo::I18n(3pm)					User Contributed Perl Documentation					Xacobeo::I18n(3pm)

NAME
Xacobeo::I18n - Utilities for internationalization (i18n). SYNOPSIS
# Initialize the i18n framework (done once) use FindBin; use Xacobeo::I18n; Xacobeo::I18n->init("$FindBin::Bin/../share/locale/"); # Import the i18n utilities (used everywhere where i18n is needed) use Xacobeo::I18n; print __("Hello world"), " "; DESCRIPTION
This package provides utilities that perform i18n. This module relies on gettext. The initialization of the i18n framework should be performed only once, preferably as soon as possible. Once the framework is initialized any module requiring to translate a string can include this module. This module exports automatically the shortcut functions used for translating messages. This is done in order to make the translation transparent. FUNCTIONS
The following functions are available: __ Translates a single string through gettext. Parameters: o $string The string to translate. __x Translates a string that uses place holders for variable substitution. Parameters: o $string The string to translate. o %values A series of key/value pairs that will be replacing the place holders. __n Translates a string in either singular or plural. Parameters: o $singular The string in its singular form (one item). o $plural The string in its plural form (more than one item). o $count The number of items. o %values A series of key/value pairs that will be replacing the place holders. __nx Translates a string in either singular or plural with variable substitution. Parameters: o $singular The string in its singular form (one item). o $plural The string in its plural form (more than one item). o $count The number of items. __xn Same as "__nx". Parameters: o $singular The string in its singular form (one item). o $plural The string in its plural form (more than one item). o $count The number of items. domain Returns the translation domain. init Initializes the i18n framework (gettext). Must be called in the fashion: Xacobeo::I18n->init($folder); Parameters: o $folder The folder where to find the translation files. For instance for the translation /usr/share/locale/fr/LC_MESSAGES/xacobeo.mo the folder /usr/share/locale has to be provided. AUTHORS
Emmanuel Rodriguez <potyl@cpan.org>. COPYRIGHT AND LICENSE
Copyright (C) 2008,2009 by Emmanuel Rodriguez. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2011-11-16 Xacobeo::I18n(3pm)

Check Out this Related Man Page

NGETTEXT(3)						     Library Functions Manual						       NGETTEXT(3)

NAME
ngettext, dngettext, dcngettext - translate message and choose plural form SYNOPSIS
#include <libintl.h> char * ngettext (const char * msgid, const char * msgid_plural, unsigned long int n); char * dngettext (const char * domainname, const char * msgid, const char * msgid_plural, unsigned long int n); char * dcngettext (const char * domainname, const char * msgid, const char * msgid_plural, unsigned long int n, int category); DESCRIPTION
The ngettext, dngettext and dcngettext functions attempt to translate a text string into the user's native language, by looking up the appropriate plural form of the translation in a message catalog. Plural forms are grammatical variants depending on the a number. Some languages have two forms, called singular and plural. Other languages have three forms, called singular, dual and plural. There are also languages with four forms. The ngettext, dngettext and dcngettext functions work like the gettext, dgettext and dcgettext functions, respectively. Additionally, they choose the appropriate plural form, which depends on the number n and the language of the message catalog where the translation was found. In the "C" locale, or if none of the used catalogs contain a translation for msgid, the ngettext, dngettext and dcngettext functions return msgid if n == 1, or msgid_plural if n != 1. RETURN VALUE
If a translation was found in one of the specified catalogs, the appropriate plural form is converted to the locale's codeset and returned. The resulting string is statically allocated and must not be modified or freed. Otherwise msgid or msgid_plural is returned, as described above. ERRORS
errno is not modified. BUGS
The return type ought to be const char *, but is char * to avoid warnings in C code predating ANSI C. SEE ALSO
gettext(3), dgettext(3), dcgettext(3) GNU gettext 0.11.4 May 2001 NGETTEXT(3)
Man Page