Publican::Translate(3pm)

Publican::Translate3pm

Module for manipulating pot and po files.

Usage

        use Publican::Translate;
        my $po = Publican::Translate->new();
        $po->update_pot();
        $po->update_po({ langs => 'fr-FR,de-DE' });
        $po->update_po({ langs => 'all' });
        $po->merge_xml({ lang  => 'fr-FR' });

Overview

Creates, updates and merges POT and PO files for Publican projects.

Interface

new

Create a new Publican::Translate object.

trans_drop

Snapshot the source to give translation a stable base.

update_pot

Update the pot files

po2xml

Merge XML and PO into a translated XML file.

update_po

Update the PO files using internal process or msgmerge

merge_po

Merge updated POT files in to existing PO files.

match_strings

Compare 2 strings and return how closely they match.

Returns a vlaue between 0 and 1, weighted for string length.

update_po_all

Update the PO files for all languages

get_msgs

Get the strings to translate from an XML::TreeBuilder object

merge_msgs

Merge translations in to XML

translate

Replace strings with translated strings.

print_msgs

Print the translation strings in an XML::TreeBuilder object to a POT file

header

Returns a valid PO header string.

detag

Format a string for use in a PO file.

po_report

Generate translation statistics for the supplied language.

Diagnostics

"unknown args %s"

All subs with named parameters will return this error when unexpected named arguments are provided.

"%s is a required argument"

Any sub with a mandatory parameter will return this error if the parameter is undef.

Configuration and environment

Publican requires no configuration files or environment variables.

Dependencies

Carp version Publican File::Path Term::ANSIColor DateTime Locale::PO XML::TreeBuilder String::Similarity

Incompatibilities

None reported.

Bugs and limitations

No bugs have been reported.

Please report any bugs or feature requests to "[email protected]", or through the web interface at <https://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Publican&amp;component=publican>.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 5 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10–12
  6. 13

Author

Jeff Fearn "<[email protected]>"

From publican 4.3.2-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.