Locale::Maketext::Gettext

Joins the gettext and Maketext frameworks.
Download

Locale::Maketext::Gettext Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • imacat
  • Publisher web site:
  • http://www.imacat.idv.tw/

Locale::Maketext::Gettext Tags


Locale::Maketext::Gettext Description

Joins the gettext and Maketext frameworks. Locale::Maketext::Gettext is a Perl module that joins the gettext and Maketext frameworks.SYNOPSISIn your localization class: package MyPackage::L10N; use base qw(Locale::Maketext::Gettext); return 1;In your application: use MyPackage::L10N; $LH = MyPackage::L10N->get_handle or die "What language?"; $LH->bindtextdomain("mypackage", "/home/user/locale"); $LH->textdomain("mypackage"); $LH->maketext("Hello, world!!");If you want to have more control to the detail: # Change the output encoding $LH->encoding("UTF-8"); # Stick with the Maketext behavior on lookup failures $LH->die_for_lookup_failures(1); # Flush the MO file cache and re-read your updated MO files $LH->reload_text; # Set the encoding of your maketext keys, if not in English $LH->key_encoding("Big5"); # Set the action when encode fails $LH->encode_failure(Encode::FB_HTMLCREF);Use Locale::Maketext::Gettext to read and parse the MO file: use Locale::Maketext::Gettext; %Lexicon = read_mo($MOfile);Locale::Maketext::Gettext joins the GNU gettext and Maketext frameworks. It is a subclass of Locale::Maketext(3) that follows the way GNU gettext works. It works seamlessly, both in the sense of GNU gettext and Maketext. As a result, you enjoy both their advantages, and get rid of both their problems, too.You start as an usual GNU gettext localization project: Work on PO files with the help of translators, reviewers and Emacs. Turn them into MO files with msgfmt. Copy them into the appropriate locale directory, such as /usr/share/locale/de/LC_MESSAGES/myapp.mo.Then, build your Maketext localization class, with your base class changed from Locale::Maketext(3) to Locale::Maketext::Gettext. Requirements: · Perl


Locale::Maketext::Gettext Related Software