Skip to Content.
Sympa Menu

Documentation for Sympa

NAME

Sympa::Language - Handling languages and locales

SYNOPSIS

use Sympa::Language;
my $language = Sympa::Language->instance;
$language->set_lang('zh-TW', 'zh', 'en');

print $language->gettext('Lorem ipsum dolor sit amet.');

DESCRIPTION

This package provides interfaces for i18n (internationalization) of Sympa.

The language tags are used to determine each language. A language tag consists of one or more subtags: language, script, region and variant. Below are some examples.

Other two sorts of identifiers are derived from language tags: gettext locales and POSIX locales.

The gettext locales determine each translation catalog. It consists of one to three parts: language, territory and modifier. For example, their equivalents of language tags above are ar, ain, pt_BR, be@latin and ca_ES@valencia, respectively.

The POSIX locales determine each locale. They have similar forms to gettext locales and are used by this package internally.

Functions

Manipulating language tags

Compatibility

As of Sympa 6.2b, language tags are used to specify languages along with locales. Earlier releases used POSIX locale names.

These functions are used to migrate data structures and configurations of earlier versions.

Methods

Getting/setting language context

Native language support (NLS)

Note:

Calls of “gettext”(), “gettext_sprintf”() and “gettext_strftime”() are extracted during packaging process and are added to translation catalog.

CAVEATS

SEE ALSO

RFC 5646 Tags for Identifying Languages. http://tools.ietf.org/html/rfc5646.

Translating Sympa. https://translate.sympa.community/pages/help.

HISTORY

Language module supporting multiple languages by single installation and using NLS catalog in msgcat format appeared on Sympa 3.0a.

Sympa 4.2b.3 adopted gettext portable object (PO) catalog and POSIX locale.

On Sympa 6.2, rewritten module Sympa::Language adopted BCP 47 language tag to determine language context, and installing POSIX locale became optional.

Top of Page