Public...anslate(3pm)
π NAME π
Publican::Translate β the module for manipulating POT and PO files, bestie. That's the whole assignment. π
It's a Perl 3pm manpage from the User Contributed Perl Documentation corner of the world, and it's giving "quiet little workhorse that does a LOT". π«Ά
β¨ SYNOPSIS β¨
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' });
Look at that. Three lines and you're already translating. π₯
π¦ DESCRIPTION π¦
Creates, updates and merges POT and PO files for Publican projects.
That's it, that's the whole job description, and honestly? Iconic. It does the thing, it does it well, no notes. πΈ
π INTERFACE π
Here come the subs, one by one, no skips, no shortcuts. We're doing all of them. π
π new
Create a new Publican::Translate object.
Fresh object, fresh vibes, main character energy. π
π trans_drop
Snapshot the source to give translation a stable base.
Basically: freeze the moment so your translators aren't chasing a moving target. Periodt. πΈ
π update_pot
Update the pot files.
π po2xml
Merge XML and PO into a translated XML file.
Two files walk in, one translated XML walks out. β¨
π update_po
Update the PO files using internal process or msgmerge.
Your choice of method, both valid, both slay. π
π 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. (Yes, vlaue. Typo said what it said. We respect the typo. π) So like, 0 = not even a little bit, 1 = twin flames, and the length of the string changes how much each character counts. π§
π update_po_all
Update the PO files for all languages.
Every language. All of them. Go off, honestly. π
π 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.
Getting the tags out of there so the PO file stays clean. π§Ό
π po_report
Generate translation statistics for the supplied language.
Numbers! For your language! So you can see how it's going. π
π©Ί DIAGNOSTICS π©Ί
π "unknown args %s"
All subs with named parameters will return this error when unexpected named arguments are provided.
So if you hand it a named arg it did not ask for, it's gonna say this. Don't take it personally, it's just boundaries. π
π "%s is a required argument"
Any sub with a mandatory parameter will return this error if the parameter is undef.
Mandatory means mandatory, bestie. If it's undef, this is what you get. π«
βοΈ CONFIGURATION AND ENVIRONMENT βοΈ
Publican requires no configuration files or environment variables.
Nothing to set up. No env vars, no config files, no homework. Just vibes. π
π¦ DEPENDENCIES π¦
It needs these, exactly as written, in this order:
CarpversionPublicanFile::PathTerm::ANSIColorDateTimeLocale::POXML::TreeBuilderString::Similarity
Make sure they're all installed or nothing's happening. π«Ά
π« INCOMPATIBILITIES π«
None reported.
Zero drama. We love a conflict-free queen. π
π BUGS AND LIMITATIONS π
No bugs have been reported.
Please report any bugs or feature requests to publican-list@redhat.com, or through the web interface at <https://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Publican&component=publican>.
Fr fr, if you find something broken, tell the humans. Email or Bugzilla, either one works. Don't suffer in silence. π
βοΈ AUTHOR βοΈ
Jeff Fearn <jfearn@redhat.com>
And that's the page, bestie. Written against perl v5.26.2, dated 2018-07-08, and you found it in the User Contributed Perl Documentation collection as Public...anslate(3pm). Go forth and translate. Slay. π
β¨
π¦ where this page comes from
- debian bookworm: publican 4.3.2-3 Β· Artistic-1.0-Perl OR GPL-2.0-or-later
- ubuntu jammy: publican 4.3.2-3 Β· Artistic-1.0-Perl OR GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms