locale files for south africa
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 10692
Locale files for South Africa 0.4
Locale files for South Africa are locale files for all official South African languages. more>>
Locale files for South Africa project are scripts to aid in localization of software. Deals with conversion between different translation formats (such as gettext-based .po formats, OpenOffice.org formats, and Mozilla formats). Also tools to help process localizations etc.
Translate.org.za is a non-profit organisation producing Free and Open Source software that enables and empowers South Africans.
The Translate Project started in 2001 with the vision of providing Free Software translated into the 11 official languages of South Africa. Free Software in your language is true empowerment.
Enhancements:
- The international dialing code has been changed from 09 to 00.
<<lessTranslate.org.za is a non-profit organisation producing Free and Open Source software that enables and empowers South Africans.
The Translate Project started in 2001 with the vision of providing Free Software translated into the 11 official languages of South Africa. Free Software in your language is true empowerment.
Enhancements:
- The international dialing code has been changed from 09 to 00.
Download (0.011MB)
Added: 2007-04-20 License: Freely Distributable Price:
919 downloads
Locale file highlighter for Vim
Locale file highlighter for Vim is highlights ISO TR 14652-style locale input files. more>>
Glibc uses locale (or fdcc) files to define cultural conventions. The files are usualy named
xx_ZZ where xx is the ISO language code and ZZ is the ISO country code.
Main features:
- highlights only valid keys with various LC_ sections
- Shows bad < UNNNN > unicode as an error
Installation
- Copy the file to your .vim/syntax directory in a locale file type: set syntax=fdcc
Filetype detection
Slightly harder as locale files do not have any specific suffix - but heres what to do
Insert this after the Diff section in your scripts.vim file. It does initial patern matching and then looks within the file to determine if it is a locale file.
The double quotes below are escaped on this site so remove those escapes. In fact it will probably mess up all back slashes aswell.
" CVS diff
else
let lnum = 1
while getline(lnum) =~ "^? " && lnum < line("$")
let lnum = lnum + 1
endwhile
if getline(lnum) =~ ^Index:s+f+$
set ft=diff
" locale input files: Formal Definitions of Cultural Conventions
" filename must be like en_US, fr_FR@euro or en_US.UTF-8
"elseif expand("%") =~ (ll_uu($|[.@])|i18n|POSIX|translit_*)
elseif expand("%") =~ aa_aa($|[.@])|i18n$|POSIX$|translit_
let lnum = 1
while lnum < 100 && lnum < line("$")
if getline(lnum) =~ ^LC_(IDENTIFICATION|CTYPE|COLLATE|MONETARY|NUMERIC|TIME|MESSAGES|PAPER|TELEPHONE|MEASUREMENT|NAME|ADDRESS)$
setf fdcc
break
endif
let lnum = lnum + 1
endwhile
endif
endif
unlet s:line2 s:line3 s:line4 s:line5
endif
<<lessxx_ZZ where xx is the ISO language code and ZZ is the ISO country code.
Main features:
- highlights only valid keys with various LC_ sections
- Shows bad < UNNNN > unicode as an error
Installation
- Copy the file to your .vim/syntax directory in a locale file type: set syntax=fdcc
Filetype detection
Slightly harder as locale files do not have any specific suffix - but heres what to do
Insert this after the Diff section in your scripts.vim file. It does initial patern matching and then looks within the file to determine if it is a locale file.
The double quotes below are escaped on this site so remove those escapes. In fact it will probably mess up all back slashes aswell.
" CVS diff
else
let lnum = 1
while getline(lnum) =~ "^? " && lnum < line("$")
let lnum = lnum + 1
endwhile
if getline(lnum) =~ ^Index:s+f+$
set ft=diff
" locale input files: Formal Definitions of Cultural Conventions
" filename must be like en_US, fr_FR@euro or en_US.UTF-8
"elseif expand("%") =~ (ll_uu($|[.@])|i18n|POSIX|translit_*)
elseif expand("%") =~ aa_aa($|[.@])|i18n$|POSIX$|translit_
let lnum = 1
while lnum < 100 && lnum < line("$")
if getline(lnum) =~ ^LC_(IDENTIFICATION|CTYPE|COLLATE|MONETARY|NUMERIC|TIME|MESSAGES|PAPER|TELEPHONE|MEASUREMENT|NAME|ADDRESS)$
setf fdcc
break
endif
let lnum = lnum + 1
endwhile
endif
endif
unlet s:line2 s:line3 s:line4 s:line5
endif
Download (0.001MB)
Added: 2005-04-13 License: GPL (GNU General Public License) Price:
1654 downloads
Edit Config Files 1.7.5 for Firefox
Edit Config Files is an extension that allows you to edit config files. more>>
Edit Config Files is an extension that allows you to edit config files.
Edit configuration files with your favorite editor from Toolbar or Tools menu.
Remove the menu icon
Add the following to userChrome.css:
#editconfigfiles-menu
{
list-style-image:none !important;
}
<<lessEdit configuration files with your favorite editor from Toolbar or Tools menu.
Remove the menu icon
Add the following to userChrome.css:
#editconfigfiles-menu
{
list-style-image:none !important;
}
Download (0.031MB)
Added: 2007-07-16 License: MPL (Mozilla Public License) Price:
842 downloads
Locale::SubCountry 1.37
Locale::SubCountry is a Perl module that can convert state, province, county etc. names to/from code. more>>
Locale::SubCountry is a Perl module that can convert state, province, county etc. names to/from code.
SYNOPSIS
my $country_code = GB;
my $UK = new Locale::SubCountry($country_code);
if ( not $UK )
{
die "Invalid code $country_coden";
}
elsif ( $UK->has_sub_countries )
{
print($UK->full_name(DGY),"n"); # Dumfries and Galloway
print($UK->regional_division(DGY),"n"); # CT (Scotland)
}
my $australia = new Locale::SubCountry(AUSTRALIA);
print($australia->country,"n"); # AUSTRALIA
print($australia->country_code,"n"); # AU
if ( $australia->has_sub_countries )
{
print($australia->code(New South Wales ),"n"); # NSW
print($australia->full_name(S.A.),"n"); # South Australia
my $upper_case = 1;
print($australia->full_name(Qld,$upper_case),"n"); # QUEENSLAND
print($australia->category(NSW),"n"); # state
print($australia->FIPS10_4_code(ACT),"n"); # 01
print($australia->ISO3166_2_code(02),"n"); # NSW
my @aus_state_names = $australia->all_full_names;
my @aus_code_names = $australia->all_codes;
my %aus_states_keyed_by_code = $australia->code_full_name_hash;
my %aus_states_keyed_by_name = $australia->full_name_code_hash;
foreach my $code ( sort keys %aus_states_keyed_by_code )
{
printf("%-3s : %sn",$code,$aus_states_keyed_by_code{$code});
}
}
# Methods for country codes and names
my $world = new Locale::SubCountry::World;
my @all_countries = $world->all_full_names;
my @all_country_codes = $world->all_codes;
my %all_countries_keyed_by_name = $world->full_name_code_hash;
my %all_country_keyed_by_code = $world->code_full_name_hash;
This module allows you to convert the full name for a countries administrative region to the code commonly used for postal addressing. The reverse lookup can also be done. Sub country codes are defined in "ISO 3166-2:1998, Codes for the representation of names of countries and their subdivisions".
Sub countries are termed as states in the US and Australia, provinces in Canada and counties in the UK and Ireland.
Names and ISO 3166-2 codes for all sub countries in a country can be returned as either a hash or an array.
Names and ISO 3166-1 codes for all countries in the world can be returned as either a hash or an array.
ISO 3166-2 codes can be converted to FIPS 10-4 codes. The reverse lookup can also be done.
<<lessSYNOPSIS
my $country_code = GB;
my $UK = new Locale::SubCountry($country_code);
if ( not $UK )
{
die "Invalid code $country_coden";
}
elsif ( $UK->has_sub_countries )
{
print($UK->full_name(DGY),"n"); # Dumfries and Galloway
print($UK->regional_division(DGY),"n"); # CT (Scotland)
}
my $australia = new Locale::SubCountry(AUSTRALIA);
print($australia->country,"n"); # AUSTRALIA
print($australia->country_code,"n"); # AU
if ( $australia->has_sub_countries )
{
print($australia->code(New South Wales ),"n"); # NSW
print($australia->full_name(S.A.),"n"); # South Australia
my $upper_case = 1;
print($australia->full_name(Qld,$upper_case),"n"); # QUEENSLAND
print($australia->category(NSW),"n"); # state
print($australia->FIPS10_4_code(ACT),"n"); # 01
print($australia->ISO3166_2_code(02),"n"); # NSW
my @aus_state_names = $australia->all_full_names;
my @aus_code_names = $australia->all_codes;
my %aus_states_keyed_by_code = $australia->code_full_name_hash;
my %aus_states_keyed_by_name = $australia->full_name_code_hash;
foreach my $code ( sort keys %aus_states_keyed_by_code )
{
printf("%-3s : %sn",$code,$aus_states_keyed_by_code{$code});
}
}
# Methods for country codes and names
my $world = new Locale::SubCountry::World;
my @all_countries = $world->all_full_names;
my @all_country_codes = $world->all_codes;
my %all_countries_keyed_by_name = $world->full_name_code_hash;
my %all_country_keyed_by_code = $world->code_full_name_hash;
This module allows you to convert the full name for a countries administrative region to the code commonly used for postal addressing. The reverse lookup can also be done. Sub country codes are defined in "ISO 3166-2:1998, Codes for the representation of names of countries and their subdivisions".
Sub countries are termed as states in the US and Australia, provinces in Canada and counties in the UK and Ireland.
Names and ISO 3166-2 codes for all sub countries in a country can be returned as either a hash or an array.
Names and ISO 3166-1 codes for all countries in the world can be returned as either a hash or an array.
ISO 3166-2 codes can be converted to FIPS 10-4 codes. The reverse lookup can also be done.
Download (0.062MB)
Added: 2006-08-16 License: Perl Artistic License Price:
1164 downloads
International Components for Unicode 3.6
International Components for Unicode provides a Unicode implementation. more>>
International Components for Unicode provides a Unicode implementation, with functions for formatting numbers, dates, times, and currencies (according to locale conventions, transliteration, and parsing text in those formats).
It provides flexible patterns for formatting messages, where the pattern determines the order of the variable parts of the messages, and the format for each of those variables. These patterns can be stored in resource files for translation to different languages. Included are more than 100 codepage converters for interaction with non-unicode systems.
Main features:
- Text: Unicode text handling, full character properties and character set conversions (500+ code pages)
- Analysis: Unicode regular expressions; full Unicode sets; character, word and line boundaries
- Comparison: language sensitive collation and searching
- Transformations: normalization, upper/lowercase, script transliterations (50+ pairs)
- Locales: comprehensive data (230+) & resource bundle architecture
- Complex Text Layout: Arabic, Hebrew, Indic and Thai
- Formatting and Parsing: multi-calendar and time zone,dates, times, numbers, currencies, messages
Enhancements:
- This is a major release, with new features, new APIs, and many bugfixes in data and code.
- ICU uses and supports Unicode 5.0, which is the latest major release of Unicode.
- CU uses and supports data from Common Locale Data Repository (CLDR) 1.4, which includes many improvements in quality and quantity of data.
- A charset detection framework was added, which provides heuristics for detecting the charset for unlabeled sequences of bytes.
- Other performance and feature enhancements were added.
<<lessIt provides flexible patterns for formatting messages, where the pattern determines the order of the variable parts of the messages, and the format for each of those variables. These patterns can be stored in resource files for translation to different languages. Included are more than 100 codepage converters for interaction with non-unicode systems.
Main features:
- Text: Unicode text handling, full character properties and character set conversions (500+ code pages)
- Analysis: Unicode regular expressions; full Unicode sets; character, word and line boundaries
- Comparison: language sensitive collation and searching
- Transformations: normalization, upper/lowercase, script transliterations (50+ pairs)
- Locales: comprehensive data (230+) & resource bundle architecture
- Complex Text Layout: Arabic, Hebrew, Indic and Thai
- Formatting and Parsing: multi-calendar and time zone,dates, times, numbers, currencies, messages
Enhancements:
- This is a major release, with new features, new APIs, and many bugfixes in data and code.
- ICU uses and supports Unicode 5.0, which is the latest major release of Unicode.
- CU uses and supports data from Common Locale Data Repository (CLDR) 1.4, which includes many improvements in quality and quantity of data.
- A charset detection framework was added, which provides heuristics for detecting the charset for unlabeled sequences of bytes.
- Other performance and feature enhancements were added.
Download (9.7MB)
Added: 2006-09-08 License: MIT/X Consortium License Price:
662 downloads
Locale::Memories 0.04
Locale::Memories is a Perl module for L10N Message Retrieval. more>>
Locale::Memories is a Perl module for L10N Message Retrieval.
SYNOPSIS
my $lm = Locale::Memories->new();
$lm->load_index(path_to_index);
$lm->index_msg($locale, $msg_id, $msg_str);
$lm->translate_msg($locale, $msg_id);
This module is specialized module for indexing and retrieving .po messages.
<<lessSYNOPSIS
my $lm = Locale::Memories->new();
$lm->load_index(path_to_index);
$lm->index_msg($locale, $msg_id, $msg_str);
$lm->translate_msg($locale, $msg_id);
This module is specialized module for indexing and retrieving .po messages.
Download (0.023MB)
Added: 2007-06-12 License: Perl Artistic License Price:
864 downloads
X-Files KDM Theme 0.1
X-Files KDM Theme is a login screen for KDE desktop manager with a nice X-Files background. more>>
X-Files KDM Theme is a login screen for KDE desktop manager with a nice X-Files background.
<<less Download (MB)
Added: 2007-03-08 License: GPL (GNU General Public License) Price:
961 downloads
fortune-mod-southpark 0.2
fortune-mod-southpark project consists of a fortune file with quotes from South Park. more>>
fortune-mod-southpark project consists of a fortune file with quotes from South Park.
South Park Fortunes is a package containing various quotes from "South Park: Bigger, Longer, and Uncut" in the UNIX fortune file format.
Examples:
Rub my nipples as I torture this little piggy!
No dude, Id be scared too, youre mom is a fucking bitch.
Dont call my mom a bitch, you fat fuck!
Dont call me fat you buttfucking son of a bitch.
Should we blame the government?
Or blame society?
Or should we blame the images on TV?
NO! Blame Canada!
Enhancements:
- Fixed typos, nothing noteworthy. Released for the sake of the English language
- probably final release
<<lessSouth Park Fortunes is a package containing various quotes from "South Park: Bigger, Longer, and Uncut" in the UNIX fortune file format.
Examples:
Rub my nipples as I torture this little piggy!
No dude, Id be scared too, youre mom is a fucking bitch.
Dont call my mom a bitch, you fat fuck!
Dont call me fat you buttfucking son of a bitch.
Should we blame the government?
Or blame society?
Or should we blame the images on TV?
NO! Blame Canada!
Enhancements:
- Fixed typos, nothing noteworthy. Released for the sake of the English language
- probably final release
Download (0.010MB)
Added: 2006-12-13 License: GPL (GNU General Public License) Price:
1050 downloads
Locale::Messages 1.16
Locale::Messages is a Perl module with Gettext Like Message Retrieval. more>>
Locale::Messages is a Perl module with Gettext Like Message Retrieval.
SYNOPSIS
use Locale::Messages (:locale_h :libintl_h);
gettext $msgid;
dgettext $textdomain, $msgid;
dcgettext $textdomain, $msgid, LC_MESSAGES;
ngettext $msgid, $msgid_plural, $count;
dngettext $textdomain, $msgid, $msgid_plural, $count;
dcngettext $textdomain, $msgid, $msgid_plural, $count, LC_MESSAGES;
textdomain $textdomain;
bindtextdomain $textdomain, $directory;
bind_textdomain_codeset $textdomain, $encoding;
bind_textdomain_filter $textdomain, &filter, $data;
turn_utf_8_on ($variable);
turn_utf_8_off ($variable);
nl_putenv (OUTPUT_CHARSET=koi8-r);
my $category = LC_CTYPE;
my $category = LC_NUMERIC;
my $category = LC_TIME;
my $category = LC_COLLATE;
my $category = LC_MONETARY;
my $category = LC_MESSAGES;
my $category = LC_ALL;
The module Locale::Messages is a wrapper around the interface to message translation according to the Uniforum approach that is for example used in GNU gettext and Suns Solaris. It is intended to allow Locale::Messages(3) to switch between different implementations of the lower level libraries but this is not yet implemented.
Normally you should not use this module directly, but the high level interface Locale::TextDomain(3) that provides a much simpler interface. This description is therefore deliberately kept brief. Please refer to the GNU gettext documentation available at http://www.gnu.org/manual/gettext/ for in-depth and background information on the topic.
The lower level module Locale::gettext_pp(3) provides the Perl implementation of gettext() and related functions.
<<lessSYNOPSIS
use Locale::Messages (:locale_h :libintl_h);
gettext $msgid;
dgettext $textdomain, $msgid;
dcgettext $textdomain, $msgid, LC_MESSAGES;
ngettext $msgid, $msgid_plural, $count;
dngettext $textdomain, $msgid, $msgid_plural, $count;
dcngettext $textdomain, $msgid, $msgid_plural, $count, LC_MESSAGES;
textdomain $textdomain;
bindtextdomain $textdomain, $directory;
bind_textdomain_codeset $textdomain, $encoding;
bind_textdomain_filter $textdomain, &filter, $data;
turn_utf_8_on ($variable);
turn_utf_8_off ($variable);
nl_putenv (OUTPUT_CHARSET=koi8-r);
my $category = LC_CTYPE;
my $category = LC_NUMERIC;
my $category = LC_TIME;
my $category = LC_COLLATE;
my $category = LC_MONETARY;
my $category = LC_MESSAGES;
my $category = LC_ALL;
The module Locale::Messages is a wrapper around the interface to message translation according to the Uniforum approach that is for example used in GNU gettext and Suns Solaris. It is intended to allow Locale::Messages(3) to switch between different implementations of the lower level libraries but this is not yet implemented.
Normally you should not use this module directly, but the high level interface Locale::TextDomain(3) that provides a much simpler interface. This description is therefore deliberately kept brief. Please refer to the GNU gettext documentation available at http://www.gnu.org/manual/gettext/ for in-depth and background information on the topic.
The lower level module Locale::gettext_pp(3) provides the Perl implementation of gettext() and related functions.
Download (0.45MB)
Added: 2007-03-06 License: Perl Artistic License Price:
962 downloads
Locale::Framework 0.06
Locale::Framework is a Perl module for internationalization. more>>
Locale::Framework is a Perl module for internationalization.
SYNOPSIS
use Locale::Framework;
use Locale::Framework::SQL;
Locale::Framework::init(new Locale::Framework::SQL(
DSN => "dbi:Pg:dbname=zclass;host=localhost",
DBUSER => "test",
DBPASS => "testpass",
[TABLE => "testtrans"]));
print _T("This is a test");
Locale::Framework::language("nl_NL");
print _T("This is a test");
Alternative interface (using wxLocale backend as an example), which does exactly the same. There is no local object scope, theres only a global class (or program that is) scope. OO interface is only for conveniance.
use Locale::Framework;
use Locale::Framework::wxLocale;
my $LOC=new Locale::Framework;
$LOC->init(new Locale::Framework::wxLocale("./locale","test"));
print _T("This is a test");
$LOC->language("nl_NL");
print _T("This is a test");
ABSTRACT
This module provides simple string based internationalization support. It exports a _T function that can be used for all text that need displayed. It can work with different backends, e.g. SQL or file based backends. The backend defaults to Locale::Framework::Dumb, which doesnt translate at all.
<<lessSYNOPSIS
use Locale::Framework;
use Locale::Framework::SQL;
Locale::Framework::init(new Locale::Framework::SQL(
DSN => "dbi:Pg:dbname=zclass;host=localhost",
DBUSER => "test",
DBPASS => "testpass",
[TABLE => "testtrans"]));
print _T("This is a test");
Locale::Framework::language("nl_NL");
print _T("This is a test");
Alternative interface (using wxLocale backend as an example), which does exactly the same. There is no local object scope, theres only a global class (or program that is) scope. OO interface is only for conveniance.
use Locale::Framework;
use Locale::Framework::wxLocale;
my $LOC=new Locale::Framework;
$LOC->init(new Locale::Framework::wxLocale("./locale","test"));
print _T("This is a test");
$LOC->language("nl_NL");
print _T("This is a test");
ABSTRACT
This module provides simple string based internationalization support. It exports a _T function that can be used for all text that need displayed. It can work with different backends, e.g. SQL or file based backends. The backend defaults to Locale::Framework::Dumb, which doesnt translate at all.
Download (0.003MB)
Added: 2006-12-04 License: Perl Artistic License Price:
1054 downloads
Locale::TextDomain 1.16
Locale::TextDomain is a Perl Interface to Uniforum Message Translation. more>>
Locale::TextDomain is a Perl Interface to Uniforum Message Translation.
SYNOPSIS
use Locale::TextDomain (my-package, @locale_dirs);
use Locale::TextDomain qw (my-package);
my $translated = __"Hello World!n";
my $alt = $__{"Hello World!n"};
my $alt2 = $__->{"Hello World!n"};
my @list = (N__"Hello", N__"World");
my @plurals = (N__ ("One world", "{num} worlds"),
N__ ("1 file", "%d files"));
my $question = __x ("Error reading file {file}: {err}",
file => $file, err => $!);
printf (__n ("one file read",
"%d files read",
$num_files),
$num_files);
print __nx ("one file read", "{num} files read", $num_files,
num => $num_files);
The module Locale::TextDomain(3pm) provides a high-level interface to Perl message translation.
Textdomains
When your request a translation for a given string, the system used in libintl-perl follows a standard strategy to find a suitable message catalog containing the translation: Unless you explicitely define a name for the message catalog, libintl-perl will assume that your catalog is called messages (unless you have changed the default value to something else via Locale::Messages(3pm), method textdomain()).
You might think that his default strategy leaves room for optimization and you are right. It would be a lot smarter if multiple software packages, all with their individual message catalogs, could be installed on one system, and it should also be possible that third-party components of your software (like Perl modules) can load their message catalogs, too, without interfering with yours.
The solution is clear, you have to assign a unique name to your message database, and you have to specify that name at run-time. That unique name is the so-called textdomain of your software package. The name is actually arbitrary but you should follow these best-practice guidelines to ensure maximum interoperability:
File System Safety
In practice, textdomains get mapped into file names, and you should therefore make sure that the textdomain you choose is a valid filename on every system that will run your software.
Case-sensitivity
Textdomains are always case-sensitive (i. e. Package and PACKAGE are not the same). However, since the message catalogs will be stored on file systems, that may or may not distinguish case when looking up file names, you should avoid potential conflicts here.
Textdomain Should Match CPAN Name
If your software is listed as a module on CPAN, you should simply choose the name on CPANS as your textdomain. The textdomain for libintl-perl is hence libintl-perl. But please replace all periods (.) in your package name with an underscore because ...
Internet Domain Names as a Fallback
... if your software is not a module listed on CPAN, as a last resort you should use the Java(tm) package scheme, i. e. choose an internet domain that you are owner of (or ask the owner of an internet domain) and concatenate your preferred textdomain with the reversed internet domain. Example: Your company runs the web-site www.foobar.org and is the owner of the domain foobar.org. The textdomain for your companys software barfoos should hence be org.foobar.barfoos.
If your software is likely to be installed in different versions on the same system, it is probably a good idea to append some version information to your textdomain.
Other systems are less strict with the naming scheme for textdomains but the phenomena known as Perl is actually a plethora of small, specialized modules and it is probably wisest to postulate some namespace model in order to avoid chaos.
Binding textdomains to directories
Once the system knows the textdomain of the message that you want to get translated into the users language, it still has to find the correct message catalog. By default, libintl-perl will look up the string in the translation database found in the directories /usr/share/locale and /usr/local/share/locale (in that order).
It is neither guaranteed that these directories exist on the target machine, nor can you be sure that the installation routine has write access to these locations. You can therefore instruct libintl-perl to search other directories prior to the default directories. Specifying a differnt search directory is called binding a textdomain to a directory.
Locale::TextDomain extends the default strategy by a Perl specific approach. Unless told otherwise, it will look for a directory LocaleData in every component found in the standard include path @INC and check for a database containing the message for your textdomain there. Example: If the path /usr/lib/perl/5.8.0/site_perl is in your @INC, you can install your translation files in /usr/lib/perl/5.8.0/site_perl/LocaleData, and they will be found at run-time.
<<lessSYNOPSIS
use Locale::TextDomain (my-package, @locale_dirs);
use Locale::TextDomain qw (my-package);
my $translated = __"Hello World!n";
my $alt = $__{"Hello World!n"};
my $alt2 = $__->{"Hello World!n"};
my @list = (N__"Hello", N__"World");
my @plurals = (N__ ("One world", "{num} worlds"),
N__ ("1 file", "%d files"));
my $question = __x ("Error reading file {file}: {err}",
file => $file, err => $!);
printf (__n ("one file read",
"%d files read",
$num_files),
$num_files);
print __nx ("one file read", "{num} files read", $num_files,
num => $num_files);
The module Locale::TextDomain(3pm) provides a high-level interface to Perl message translation.
Textdomains
When your request a translation for a given string, the system used in libintl-perl follows a standard strategy to find a suitable message catalog containing the translation: Unless you explicitely define a name for the message catalog, libintl-perl will assume that your catalog is called messages (unless you have changed the default value to something else via Locale::Messages(3pm), method textdomain()).
You might think that his default strategy leaves room for optimization and you are right. It would be a lot smarter if multiple software packages, all with their individual message catalogs, could be installed on one system, and it should also be possible that third-party components of your software (like Perl modules) can load their message catalogs, too, without interfering with yours.
The solution is clear, you have to assign a unique name to your message database, and you have to specify that name at run-time. That unique name is the so-called textdomain of your software package. The name is actually arbitrary but you should follow these best-practice guidelines to ensure maximum interoperability:
File System Safety
In practice, textdomains get mapped into file names, and you should therefore make sure that the textdomain you choose is a valid filename on every system that will run your software.
Case-sensitivity
Textdomains are always case-sensitive (i. e. Package and PACKAGE are not the same). However, since the message catalogs will be stored on file systems, that may or may not distinguish case when looking up file names, you should avoid potential conflicts here.
Textdomain Should Match CPAN Name
If your software is listed as a module on CPAN, you should simply choose the name on CPANS as your textdomain. The textdomain for libintl-perl is hence libintl-perl. But please replace all periods (.) in your package name with an underscore because ...
Internet Domain Names as a Fallback
... if your software is not a module listed on CPAN, as a last resort you should use the Java(tm) package scheme, i. e. choose an internet domain that you are owner of (or ask the owner of an internet domain) and concatenate your preferred textdomain with the reversed internet domain. Example: Your company runs the web-site www.foobar.org and is the owner of the domain foobar.org. The textdomain for your companys software barfoos should hence be org.foobar.barfoos.
If your software is likely to be installed in different versions on the same system, it is probably a good idea to append some version information to your textdomain.
Other systems are less strict with the naming scheme for textdomains but the phenomena known as Perl is actually a plethora of small, specialized modules and it is probably wisest to postulate some namespace model in order to avoid chaos.
Binding textdomains to directories
Once the system knows the textdomain of the message that you want to get translated into the users language, it still has to find the correct message catalog. By default, libintl-perl will look up the string in the translation database found in the directories /usr/share/locale and /usr/local/share/locale (in that order).
It is neither guaranteed that these directories exist on the target machine, nor can you be sure that the installation routine has write access to these locations. You can therefore instruct libintl-perl to search other directories prior to the default directories. Specifying a differnt search directory is called binding a textdomain to a directory.
Locale::TextDomain extends the default strategy by a Perl specific approach. Unless told otherwise, it will look for a directory LocaleData in every component found in the standard include path @INC and check for a database containing the message for your textdomain there. Example: If the path /usr/lib/perl/5.8.0/site_perl is in your @INC, you can install your translation files in /usr/lib/perl/5.8.0/site_perl/LocaleData, and they will be found at run-time.
Download (0.45MB)
Added: 2007-01-24 License: Perl Artistic License Price:
1015 downloads
Locale::Maketext::Simple 0.18
Locale::Maketext::Simple is a simple interface to Locale::Maketext::Lexicon. more>>
Locale::Maketext::Simple is a simple interface to Locale::Maketext::Lexicon.
SYNOPSIS
Minimal setup (looks for auto/Foo/*.po and auto/Foo/*.mo):
package Foo;
use Locale::Maketext::Simple; # exports loc
loc_lang(fr); # set language to French
sub hello {
print loc("Hello, [_1]!", "World");
}
More sophisticated example:
package Foo::Bar;
use Locale::Maketext::Simple (
Class => Foo, # search in auto/Foo/
Style => gettext, # %1 instead of [_1]
Export => maketext, # maketext() instead of loc()
Subclass => L10N, # Foo::L10N instead of Foo::I18N
Decode => 1, # decode entries to unicode-strings
Encoding => locale, # but encode lexicons in current locale
# (needs Locale::Maketext::Lexicon 0.36)
);
sub japh {
print maketext("Just another %1 hacker", "Perl");
}
This module is a simple wrapper around Locale::Maketext::Lexicon, designed to alleviate the need of creating Language Classes for module authors.
If Locale::Maketext::Lexicon is not present, it implements a minimal localization function by simply interpolating [_1] with the first argument, [_2] with the second, etc. Interpolated function like [quant,_1] are treated as [_1], with the sole exception of [tense,_1,X], which will append ing to _1 when X is present, or appending ed to otherwise.
<<lessSYNOPSIS
Minimal setup (looks for auto/Foo/*.po and auto/Foo/*.mo):
package Foo;
use Locale::Maketext::Simple; # exports loc
loc_lang(fr); # set language to French
sub hello {
print loc("Hello, [_1]!", "World");
}
More sophisticated example:
package Foo::Bar;
use Locale::Maketext::Simple (
Class => Foo, # search in auto/Foo/
Style => gettext, # %1 instead of [_1]
Export => maketext, # maketext() instead of loc()
Subclass => L10N, # Foo::L10N instead of Foo::I18N
Decode => 1, # decode entries to unicode-strings
Encoding => locale, # but encode lexicons in current locale
# (needs Locale::Maketext::Lexicon 0.36)
);
sub japh {
print maketext("Just another %1 hacker", "Perl");
}
This module is a simple wrapper around Locale::Maketext::Lexicon, designed to alleviate the need of creating Language Classes for module authors.
If Locale::Maketext::Lexicon is not present, it implements a minimal localization function by simply interpolating [_1] with the first argument, [_2] with the second, etc. Interpolated function like [quant,_1] are treated as [_1], with the sole exception of [tense,_1,X], which will append ing to _1 when X is present, or appending ed to otherwise.
Download (0.016MB)
Added: 2007-02-09 License: Perl Artistic License Price:
987 downloads
Locale::KeyedText 1.73.0
Locale::KeyedText is a Perl module that refer to user messages in programs by keys. more>>
Locale::KeyedText is a Perl module that refers to user messages in programs by keys.
It also describes the same-number versions of Locale::KeyedText::Message ("Message") and Locale::KeyedText::Translator ("Translator").
Note that the "Locale::KeyedText" package serves only as the name-sake representative for this whole file, which can be referenced as a unit by documentation or use statements or Perl archive indexes. Aside from use statements, you should never refer directly to "Locale::KeyedText" in your code; instead refer to other above-named packages in this file.
SYNOPSIS
use Locale::KeyedText;
main();
sub main {
# Create a translator.
my $translator = Locale::KeyedText::Translator->new({
set_names => [MyLib::Lang::, MyApp::Lang::],
# set package prefixes for localized app components
member_names => [Eng, Fr, De, Esp],
# set list of available languages in order of preference
});
# This will print Enter 2 Numbers in the first of the four
# languages that has a matching template available.
print $translator->translate_message(
Locale::KeyedText::Message->new({
msg_key => MYAPP_PROMPT }) );
# Read two numbers from the user.
my ($first, $second) = ;
# Print a statement giving the operands and their sum.
MyLib->add_two( $first, $second, $translator );
}
package MyLib; # module
sub add_two {
my (undef, $first, $second, $translator) = @_;
my $sum = $first + $second;
# This will print plus equals in
# the first possible language. For example, if the user
# inputs 3 and 4, it the output will be 3 plus 4 equals 7.
print $translator->translate_message(
Locale::KeyedText::Message->new({ msg_key => MYLIB_RESULT,
msg_vars => { FIRST => $first, SECOND => $second,
RESULT => $sum } }) );
}
Many times during a programs operation, the program (or a package it uses) will need to display a message to the user, or generate a message to be shown to the user. Sometimes this is an error message of some kind, but it could also be a prompt or response message for interactive systems.
If the program or any of its components are intended for widespread use then it needs to account for a variance of needs between its different users, such as their preferred language of communication, or their privileges regarding access to information details, or their technical skills. For example, a native French or Chinese speaker often prefers to communicate in those languages. Or, when viewing an error message, the applications developer should see more details than joe public would.
Alternately, sometimes a program will raise a condition or error that, while resembling a message that would be shown to a user, is in fact meant to be interpreted by the machine itself and not any human user. In some situations, a shared program component may raise such a condition, and one application may handle it internally, while another one displays it to the user instead.
Locale::KeyedText provides a simple but effective mechanism for applications and packages that empowers single binaries to support N locales or user types simultaneously, and that allows any end users to add support for new languages easily and without a recompile (such as by simply copying files), often even while the program is executing.
Locale::KeyedText gives your application the maximum amount of control as to what the user sees; it never outputs anything by itself to the user, but rather returns its results for calling code to output as it sees fit. It also does not make direct use of environment variables, which can aid in portability.
Practically speaking, Locale::KeyedText doesnt actually do a lot internally; it exists mainly to document a certain localization methodology in an easily accessable manner, such that would not be possible if its functionality was subsumed into a larger package that would otherwise use it. Hereafter, if any other package or application says that it uses Locale::KeyedText, that is a terse way of saying that it subscribes to the localization methodology that is described here, and hence provides these benefits to developers and users alike.
For some practical examples of Locale::KeyedText in use, see the /examples directory of this distribution. Or, see my dependent CPAN packages whose problem domain is databases and/or SQL.
<<lessIt also describes the same-number versions of Locale::KeyedText::Message ("Message") and Locale::KeyedText::Translator ("Translator").
Note that the "Locale::KeyedText" package serves only as the name-sake representative for this whole file, which can be referenced as a unit by documentation or use statements or Perl archive indexes. Aside from use statements, you should never refer directly to "Locale::KeyedText" in your code; instead refer to other above-named packages in this file.
SYNOPSIS
use Locale::KeyedText;
main();
sub main {
# Create a translator.
my $translator = Locale::KeyedText::Translator->new({
set_names => [MyLib::Lang::, MyApp::Lang::],
# set package prefixes for localized app components
member_names => [Eng, Fr, De, Esp],
# set list of available languages in order of preference
});
# This will print Enter 2 Numbers in the first of the four
# languages that has a matching template available.
print $translator->translate_message(
Locale::KeyedText::Message->new({
msg_key => MYAPP_PROMPT }) );
# Read two numbers from the user.
my ($first, $second) = ;
# Print a statement giving the operands and their sum.
MyLib->add_two( $first, $second, $translator );
}
package MyLib; # module
sub add_two {
my (undef, $first, $second, $translator) = @_;
my $sum = $first + $second;
# This will print plus equals in
# the first possible language. For example, if the user
# inputs 3 and 4, it the output will be 3 plus 4 equals 7.
print $translator->translate_message(
Locale::KeyedText::Message->new({ msg_key => MYLIB_RESULT,
msg_vars => { FIRST => $first, SECOND => $second,
RESULT => $sum } }) );
}
Many times during a programs operation, the program (or a package it uses) will need to display a message to the user, or generate a message to be shown to the user. Sometimes this is an error message of some kind, but it could also be a prompt or response message for interactive systems.
If the program or any of its components are intended for widespread use then it needs to account for a variance of needs between its different users, such as their preferred language of communication, or their privileges regarding access to information details, or their technical skills. For example, a native French or Chinese speaker often prefers to communicate in those languages. Or, when viewing an error message, the applications developer should see more details than joe public would.
Alternately, sometimes a program will raise a condition or error that, while resembling a message that would be shown to a user, is in fact meant to be interpreted by the machine itself and not any human user. In some situations, a shared program component may raise such a condition, and one application may handle it internally, while another one displays it to the user instead.
Locale::KeyedText provides a simple but effective mechanism for applications and packages that empowers single binaries to support N locales or user types simultaneously, and that allows any end users to add support for new languages easily and without a recompile (such as by simply copying files), often even while the program is executing.
Locale::KeyedText gives your application the maximum amount of control as to what the user sees; it never outputs anything by itself to the user, but rather returns its results for calling code to output as it sees fit. It also does not make direct use of environment variables, which can aid in portability.
Practically speaking, Locale::KeyedText doesnt actually do a lot internally; it exists mainly to document a certain localization methodology in an easily accessable manner, such that would not be possible if its functionality was subsumed into a larger package that would otherwise use it. Hereafter, if any other package or application says that it uses Locale::KeyedText, that is a terse way of saying that it subscribes to the localization methodology that is described here, and hence provides these benefits to developers and users alike.
For some practical examples of Locale::KeyedText in use, see the /examples directory of this distribution. Or, see my dependent CPAN packages whose problem domain is databases and/or SQL.
Download (0.035MB)
Added: 2006-09-19 License: Perl Artistic License Price:
1130 downloads
Locale::Maketext::Lexicon 0.62
Locale::Maketext::Lexicon is a Perl module to use other catalog formats in Maketext. more>>
Locale::Maketext::Lexicon is a Perl module to use other catalog formats in Maketext.
SYNOPSIS
As part of a localization class, automatically glob for available lexicons:
package Hello::I18N;
use base Locale::Maketext;
use Locale::Maketext::Lexicon {
* => [Gettext => /usr/local/share/locale/*/LC_MESSAGES/hello.mo],
### Uncomment to decode lexicon entries into Unicode strings
# _decode => 1,
### Uncomment to fallback when a key is missing from lexicons
# _auto => 1,
### Uncomment to use %1 / %quant(%1) instead of [_1] / [quant, _1]
# _style => gettext,
};
Explicitly specify languages, during compile- or run-time:
package Hello::I18N;
use base Locale::Maketext;
use Locale::Maketext::Lexicon {
de => [Gettext => hello_de.po],
fr => [
Gettext => hello_fr.po,
Gettext => local/hello/fr.po,
],
};
# ... incrementally add new lexicons
Locale::Maketext::Lexicon->import({
de => [Gettext => local/hello/de.po],
})
Alternatively, as part of a localization subclass:
package Hello::I18N::de;
use base Hello::I18N;
use Locale::Maketext::Lexicon (Gettext => *DATA);
__DATA__
# Some sample data
msgid ""
msgstr ""
"Project-Id-Version: Hello 1.3.22.1n"
"MIME-Version: 1.0n"
"Content-Type: text/plain; charset=iso8859-1n"
"Content-Transfer-Encoding: 8bitn"
#: Hello.pm:10
msgid "Hello, World!"
msgstr "Hallo, Welt!"
#: Hello.pm:11
msgid "You have %quant(%1,piece) of mail."
msgstr "Sie haben %quant(%1,Poststueck,Poststuecken)."
This module provides lexicon-handling modules to read from other localization formats, such as Gettext, Msgcat, and so on.
If you are unfamiliar with the concept of lexicon modules, please consult Locale::Maketext and http://www.autrijus.org/webl10n/ first.
A command-line utility xgettext.pl is also installed with this module, for extracting translatable strings from source files.
<<lessSYNOPSIS
As part of a localization class, automatically glob for available lexicons:
package Hello::I18N;
use base Locale::Maketext;
use Locale::Maketext::Lexicon {
* => [Gettext => /usr/local/share/locale/*/LC_MESSAGES/hello.mo],
### Uncomment to decode lexicon entries into Unicode strings
# _decode => 1,
### Uncomment to fallback when a key is missing from lexicons
# _auto => 1,
### Uncomment to use %1 / %quant(%1) instead of [_1] / [quant, _1]
# _style => gettext,
};
Explicitly specify languages, during compile- or run-time:
package Hello::I18N;
use base Locale::Maketext;
use Locale::Maketext::Lexicon {
de => [Gettext => hello_de.po],
fr => [
Gettext => hello_fr.po,
Gettext => local/hello/fr.po,
],
};
# ... incrementally add new lexicons
Locale::Maketext::Lexicon->import({
de => [Gettext => local/hello/de.po],
})
Alternatively, as part of a localization subclass:
package Hello::I18N::de;
use base Hello::I18N;
use Locale::Maketext::Lexicon (Gettext => *DATA);
__DATA__
# Some sample data
msgid ""
msgstr ""
"Project-Id-Version: Hello 1.3.22.1n"
"MIME-Version: 1.0n"
"Content-Type: text/plain; charset=iso8859-1n"
"Content-Transfer-Encoding: 8bitn"
#: Hello.pm:10
msgid "Hello, World!"
msgstr "Hallo, Welt!"
#: Hello.pm:11
msgid "You have %quant(%1,piece) of mail."
msgstr "Sie haben %quant(%1,Poststueck,Poststuecken)."
This module provides lexicon-handling modules to read from other localization formats, such as Gettext, Msgcat, and so on.
If you are unfamiliar with the concept of lexicon modules, please consult Locale::Maketext and http://www.autrijus.org/webl10n/ first.
A command-line utility xgettext.pl is also installed with this module, for extracting translatable strings from source files.
Download (0.082MB)
Added: 2007-02-14 License: MIT/X Consortium License Price:
982 downloads
Locale::Maketext::Lexicon::Msgcat 0.62
Locale::Maketext::Lexicon::Msgcat is a Msgcat catalog parser Maketext. more>>
Locale::Maketext::Lexicon::Msgcat is a Msgcat catalog parser Maketext.
SYNOPSIS
package Hello::I18N;
use base Locale::Maketext;
use Locale::Maketext::Lexicon {
en => [Msgcat, en_US/hello.pl.m],
};
package main;
my $lh = Hello::I18N->get_handle(en);
print $lh->maketext(1,2); # set 1, msg 2
print $lh->maketext("1,2"); # same thing
This module parses one or more Msgcat catalogs in plain text format, and returns a Lexicon hash, which may be looked up either with a two-argument form ($set_id, $msg_id) or as a single string ("$set_id,$msg_id").
<<lessSYNOPSIS
package Hello::I18N;
use base Locale::Maketext;
use Locale::Maketext::Lexicon {
en => [Msgcat, en_US/hello.pl.m],
};
package main;
my $lh = Hello::I18N->get_handle(en);
print $lh->maketext(1,2); # set 1, msg 2
print $lh->maketext("1,2"); # same thing
This module parses one or more Msgcat catalogs in plain text format, and returns a Lexicon hash, which may be looked up either with a two-argument form ($set_id, $msg_id) or as a single string ("$set_id,$msg_id").
Download (0.082MB)
Added: 2007-02-14 License: MIT/X Consortium License Price:
983 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above locale files for south africa search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed