locale files for south africa 0.4
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 11234
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
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
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
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
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
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
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::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
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::Object::Language 0.75
Locale::Object::Language Perl module contains language information objects. more>>
Locale::Object::Language Perl module contains language information objects.
Locale::Object::Language allows you to create objects containing information about languages such as their ISO codes, the countries theyre used in and so on.
SYNOPSIS
use Locale::Object::Language;
my $eng = Locale::Object::Language->new( code_alpha3 => eng );
my $name = $eng->name;
my $code_alpha2 = $eng->code_alpha2;
my $code_alpha3 = $eng->code_alpha3;
my @countries = $eng->countries;
my $gb = Locale::Object::Country->new( code_alpha2 => gb );
print $eng->official($gb);
METHODS
new()
my $eng = Locale::Object::Language->new( code_alpha3 => eng );
The new method creates an object. It takes a single-item hash as an argument - valid options to pass are ISO 3166 values - code_alpha2, code_alpha3 and name (see Locale::Object::DB::Schemata for details on these).
The objects created are singletons; if you try and create a currency object when one matching your specification already exists, new() will return the original one.
name(), code_alpha2(), code_alpha3()
my $name = $country->name;
These methods retrieve the values of the attributes in the object whose name they share.
countries()
my @countries = $eng->countries;
Returns an array (in array context, otherwise a reference) of Locale::Object::Country objects with their ISO 3166 alpha2 codes as keys (see Locale::Object::DB::Schemata for more details on those) for all countries using this currency in array context, or a reference in scalar context. The objects have their own attribute methods, so you can do things like this for example:
foreach my $place (@countries)
{
print $place->name, "n";
}
Which will list you all the countries that use in that currency. See the documentation for Locale::Object::Country for a listing of country attributes. Note that you can chain methods as well.
foreach my $place (@countries)
{
print $place->continent->name, "n";
}
official()
my $gb = Locale::Object::Country->new( code_alpha2 => gb );
print $eng->official($gb); # prints true
Give this method a Locale::Object::Country object, and it will return a true or false value for whether the country the object represents has the language represented by your Locale::Object::Language object as an official language. See database.pod for a note about languages in the database.
<<lessLocale::Object::Language allows you to create objects containing information about languages such as their ISO codes, the countries theyre used in and so on.
SYNOPSIS
use Locale::Object::Language;
my $eng = Locale::Object::Language->new( code_alpha3 => eng );
my $name = $eng->name;
my $code_alpha2 = $eng->code_alpha2;
my $code_alpha3 = $eng->code_alpha3;
my @countries = $eng->countries;
my $gb = Locale::Object::Country->new( code_alpha2 => gb );
print $eng->official($gb);
METHODS
new()
my $eng = Locale::Object::Language->new( code_alpha3 => eng );
The new method creates an object. It takes a single-item hash as an argument - valid options to pass are ISO 3166 values - code_alpha2, code_alpha3 and name (see Locale::Object::DB::Schemata for details on these).
The objects created are singletons; if you try and create a currency object when one matching your specification already exists, new() will return the original one.
name(), code_alpha2(), code_alpha3()
my $name = $country->name;
These methods retrieve the values of the attributes in the object whose name they share.
countries()
my @countries = $eng->countries;
Returns an array (in array context, otherwise a reference) of Locale::Object::Country objects with their ISO 3166 alpha2 codes as keys (see Locale::Object::DB::Schemata for more details on those) for all countries using this currency in array context, or a reference in scalar context. The objects have their own attribute methods, so you can do things like this for example:
foreach my $place (@countries)
{
print $place->name, "n";
}
Which will list you all the countries that use in that currency. See the documentation for Locale::Object::Country for a listing of country attributes. Note that you can chain methods as well.
foreach my $place (@countries)
{
print $place->continent->name, "n";
}
official()
my $gb = Locale::Object::Country->new( code_alpha2 => gb );
print $eng->official($gb); # prints true
Give this method a Locale::Object::Country object, and it will return a true or false value for whether the country the object represents has the language represented by your Locale::Object::Language object as an official language. See database.pod for a note about languages in the database.
Download (0.046MB)
Added: 2007-06-12 License: Perl Artistic License Price:
864 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::Maketext::Lexicon::Tie 0.62
Locale::Maketext::Lexicon::Tie is a Perl module to use tied hashes as lexicons for Maketext. more>>
Locale::Maketext::Lexicon::Tie is a Perl module to use tied hashes as lexicons for Maketext.
SYNOPSIS
package Hello::I18N;
use base Locale::Maketext;
use Locale::Maketext::Lexicon {
en => [ Tie => [ DB_File => en.db ] ],
};
This module lets you easily tie the %Lexicon hash to a database or other data sources. It takes an array reference of arguments, and passes them directly to tie().
Entries will then be fetched whenever it is used; this module does not cache them.
<<lessSYNOPSIS
package Hello::I18N;
use base Locale::Maketext;
use Locale::Maketext::Lexicon {
en => [ Tie => [ DB_File => en.db ] ],
};
This module lets you easily tie the %Lexicon hash to a database or other data sources. It takes an array reference of arguments, and passes them directly to tie().
Entries will then be fetched whenever it is used; this module does not cache them.
Download (0.082MB)
Added: 2007-02-20 License: Perl Artistic License Price:
977 downloads
Geotrace 0.0.4
Geotrace is a geographical traceroute utility. more>>
Geotrace is a geographical traceroute utility. Geotrace provide graphical view on the map. It has many geographical maps.
In order to be able to use a new map with geotrace, you only need to know one thing: the longitude/latitude of the top left and bottom right corners. Most maps you will find will be centered on 0,0 (about 5 degs south of Ghana and 10 degs west of Gabon. for those of you who dont know, its in Africa.). So, lets do it step by step:
1) Find a map. there are plenty on the web. Nasas a good place to find them (it is a mess though). Or grab one of the few maps at a site with maps for XGlobe and XPlanet.
The image must be in a format understood by gdk-pixbuf (most images youll find will be jpeg or gif which work).
2) Go to the maps/ directory in geotrace. Put the map in there and open up maps.properties
3) on the second line, youll see MAPS:World50.gif, World100.gif etc... Thats a list of all the maps. Add the name of your recently downloaded map on that line.
4) now, you need to tell geotrace what the coordinates are. Add a line to the file that looks as follows:
filename:BOUNDARY=lon1,lat1,lon2,lat2
filename: case sensitive, map has to be in the maps/ folder
lon1 and lat1: longitude and latitude of the top left corner
lon2 and lat2: longitude and latitude of the bottom right corner
As I said earlier, for most maps youll find, youll get -180,90,180,-90 which means that the map is centered on 0,0. However, the two world maps (World100 and World50) in geotrace are centered on 10W,0
You might notice that the three maps of the US have another line associated with them. Thats the alber projection. You probably wont have to deal with that.
4) Run geotrace, select your map from the drop-down and enjoy.
Version restrictions:
- Some hops may have extravagant locations, but for once, its not my fault. The netgeo server does not have fully updated records. So my advice is, just live with it
Enhancements:
- added line color and width options.
- added cmdline args. host to trace, and startup map.
- added map options: path to maps and startup map.
- warning to check paths when run for the first time.
- added status bar
- fixed draw_trace_on_map which didnt draw in certain cases (timeouts)
- fixed bug that caused crash when a hop times out and more hops repond later
- 2001-04-05
- added option: resolve host name or not
- load/save options from file (~/.geotrace) 2001-04-04
- fixed bug that caused last map in file not to be read (world100) 2001-04-03 added options for traceroute (path to exec, timeout and maxttl)
<<lessIn order to be able to use a new map with geotrace, you only need to know one thing: the longitude/latitude of the top left and bottom right corners. Most maps you will find will be centered on 0,0 (about 5 degs south of Ghana and 10 degs west of Gabon. for those of you who dont know, its in Africa.). So, lets do it step by step:
1) Find a map. there are plenty on the web. Nasas a good place to find them (it is a mess though). Or grab one of the few maps at a site with maps for XGlobe and XPlanet.
The image must be in a format understood by gdk-pixbuf (most images youll find will be jpeg or gif which work).
2) Go to the maps/ directory in geotrace. Put the map in there and open up maps.properties
3) on the second line, youll see MAPS:World50.gif, World100.gif etc... Thats a list of all the maps. Add the name of your recently downloaded map on that line.
4) now, you need to tell geotrace what the coordinates are. Add a line to the file that looks as follows:
filename:BOUNDARY=lon1,lat1,lon2,lat2
filename: case sensitive, map has to be in the maps/ folder
lon1 and lat1: longitude and latitude of the top left corner
lon2 and lat2: longitude and latitude of the bottom right corner
As I said earlier, for most maps youll find, youll get -180,90,180,-90 which means that the map is centered on 0,0. However, the two world maps (World100 and World50) in geotrace are centered on 10W,0
You might notice that the three maps of the US have another line associated with them. Thats the alber projection. You probably wont have to deal with that.
4) Run geotrace, select your map from the drop-down and enjoy.
Version restrictions:
- Some hops may have extravagant locations, but for once, its not my fault. The netgeo server does not have fully updated records. So my advice is, just live with it
Enhancements:
- added line color and width options.
- added cmdline args. host to trace, and startup map.
- added map options: path to maps and startup map.
- warning to check paths when run for the first time.
- added status bar
- fixed draw_trace_on_map which didnt draw in certain cases (timeouts)
- fixed bug that caused crash when a hop times out and more hops repond later
- 2001-04-05
- added option: resolve host name or not
- load/save options from file (~/.geotrace) 2001-04-04
- fixed bug that caused last map in file not to be read (world100) 2001-04-03 added options for traceroute (path to exec, timeout and maxttl)
Download (0.25MB)
Added: 2006-06-21 License: GPL (GNU General Public License) Price:
1229 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 0.4 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