| Typist documentation | Contained in the Typist distribution. |
Typist::L10N - Base class for localization services
Adds lexical elements to the template engine
Checks if a phrase is already it the language Typist is initialized for the given phrase.
| Typist documentation | Contained in the Typist distribution. |
package Typist::L10N; use strict; use base qw( Locale::Maketext ); @Typist::L10N::Lexicon = (_AUTO => 1); sub language_name { my $tag = $_[0]->language_tag; require I18N::LangTags::List; I18N::LangTags::List::name($tag); } sub encoding { 'iso-8859-1' } ## Latin-1 sub ascii_only { 0 } #--- for plugins sub add_lexicon { no strict 'refs'; my $lex = *{ref(Typist->language_handle) . '::Lexicon'}{'HASH'}; map { $lex->{$_} = $_[1]->{$_} } keys %{$_[1]}; } sub has_lexicon { # phrase??? no strict 'refs'; my $lex = *{ref(Typist->language_handle) . '::Lexicon'}{'HASH'}; exists $lex->{$_[1]}; } 1; __END__