Locale::Maketext::Pseudo

Give localized code a pseudo language obj if a real one does not exist
Download

Locale::Maketext::Pseudo Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Daniel Muey
  • Publisher web site:
  • http://search.cpan.org/~dmuey/

Locale::Maketext::Pseudo Tags


Locale::Maketext::Pseudo Description

Give localized code a pseudo language obj if a real one does not exist Localized software is more useable by more people. You should localize your code. Locale::Maketext is a Perl module that has the easiest and best localization framework available, Local::Maketext::Utils adds more useablility utility methods (for example, it adds say(), get(), print(), and fetch() to name just a few) and should be used in software of any size.In a perfect world your main program would make a language object and pass it as part of an object constructor so that output the module might have is localized too.What is your excellently localized module to do if no valid langauge object is passed? Or what can you do while you're setting up your Lexicon and what not?You fallback to a Pseudo object so that the calls to maketext() (or say(), get(), print(), or fetch() if you'll be using a Locale::Maketext::Utils obj) can be used and still get interpolated properly.SYNOPSIS use Locale::Maketext::Pseudo; # localized Class::Std based object my %lang; sub BUILD { my ($self, $ident, $arg_ref) = @_; $lang{ $ident } = ref $arg_ref->{'lang_obj'} && $arg_ref->{'lang_obj'}->can('maketext') ? $arg_ref->{'lang_obj'} : Locale::Maketext::Pseudo->new(); ... }Or in your main app so you can get on with writing it and have $lang available and functioning # TODO: setup Locale::Maketext::Utils based Lexicon and make $lang out of it but for now: my $lang = Locale::Maketext::Pseudo->new(); Requirements: · Perl


Locale::Maketext::Pseudo Related Software