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 the translation strings in an XML::TreeBuilder object to a POT file.

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:

  • Carp
  • version
  • Publican
  • File::Path
  • Term::ANSIColor
  • DateTime
  • Locale::PO
  • XML::TreeBuilder
  • String::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&amp;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