NAME
CatalystX::I18N::Maketext - Wrapper around Locale::Maketext
SYNOPSIS
package MyApp::Maketext;
use parent qw(CatalystX::I18N::Maketext);
DESCRIPTION
This class can be used as your Maketext base-class. It is a wrapper around Locale::Maketext and provides methods for auto-loading lexicon files. It is designed to work toghether with CatalystX::Model::Maketext.
You need to subclass this package in your project in order to use it.
MEDTHODS
load_lexicon
MyApp::Maketext->load_lexicon(
locales => ['de','de_AT'], # Required
directories => ['/path/to/your/maketext/files'], # Required
gettext_style => 0, # Optional, Default 1
inheritance => { # Optional
de_AT => 'de',
},
);
This method will search the given directories and load all available maketext files for the requested locales
*.mo, *.po
*.db
via Locale::Maketext::Lexicon::Tie The files will be tied to you Maketext class, thus you need to implement the necessary tie methods in your class.
*.m
Directories
Perl Packages
Will be loaded (only lowercase locale names e.g. locale 'de_AT' will only load 'de_at.pm'). The packages must have a
%Lexion
variable.
If no translation files can be found for a given locale then Locale::Maketext::Lexicon::Auto will be loaded.
The following parameters are recognized/required
locales
Array reference of locales.
Required
directories
Array reference of directories. Also accepts Path::Class::Dir objects and single values.
Required
gettext_style
Enable gettext style.
%quant(%1,document,documents)
instead of[quant,_1,document,documents]
Optional, Default TRUE
inheritance
Set inheritance as as HashRef (e.g. 'en_US' inherits from 'en')
Optional
SEE ALSO
Locale::Maketext and Locale::Maketext::Lexicon
AUTHOR
Maroš Kollár
CPAN ID: MAROS
maros [at] k-1.com
L<http://www.revdev.at>