LOCALE:...EXT.3PM(1)

🌸 LOCALE:…EXT.3PM β€” the Locale::Po4a::Text era πŸ’…

okay bestie, so this is a Perl man page from the User Contributed Perl Documentation corner of the universe, and it's about Locale::Po4a::Text β€” a module that converts text documents from/to PO files. yes, both directions. it's giving bilingual icon behavior ✨


πŸŽ€ NAME πŸŽ€

Locale::Po4a::Text β€” converts text documents from/to PO files. periodt.


πŸ’– DESCRIPTION πŸ’–

so the whole po4a (PO for anything) project has one goal: make translations easier β€” and honestly, even more interestingly, make maintaining translations easier β€” by using gettext tools on places nobody expected them, like documentation. lowkey genius 🧠✨

Locale::Po4a::Text is the module that helps you translate text documents into other [human] languages. yes, human β€” that's literally in the brackets, iykyk 🫢

the rules of the land:

  • paragraphs get split on empty lines (or on lines that contain only spaces or tabulations). that's the divider, bestie πŸŽ€
  • if a paragraph contains a line starting with a space (or a tabulation), that paragraph will not be rewrapped. nope. it's staying exactly how it is πŸ’…

✨ OPTIONS ACCEPTED BY THIS MODULE ✨

these are this module's very own particular options, and honestly? each one ate:

  • keyvalue β€” treat paragraphs that look like a colon-separated key-value pair as verbatim (with the no-wrap flag in the PO file). and what counts as a key-value pair string? a string like key: value β€” meaning it contains one or more non-colon and non-space characters, followed by a colon, followed by at least one non-space character before the end of the line. precise. iconic. πŸ’…
  • nobullets β€” deactivates the detection of bullets. bye bye bullet detection 🫑

by default, when a bullet is detected, the bullet paragraph is not considered a verbatim paragraph (with the no-wrap flag in the PO file). instead, the corresponding paragraph gets rewrapped in the translation. so this flag is the "actually, don't" button πŸ™ˆ

  • tabs=mode β€” specifies how tabulations shall be handled. mode can be any of these two cuties:
    • split β€” lines with tabulations introduce breaks in the current paragraph. tab = new paragraph energy πŸ’€
    • verbatim β€” paragraphs containing tabulations will not be re-wrapped. hands off βœ‹

by default, tabulations are just considered as spaces. no drama 🌸

  • breaks=regex β€” a regular expression matching lines which introduce breaks. and heads up, the regex will be anchored, so the whole line must match. no partial matches, bestie 🎯
  • debianchangelog β€” handles the header and footer of released versions, which only contain non-translatable information. so we skip the boring bits 🌈
  • fortunes β€” handles the fortunes format, which separates fortunes with a line that consists in % or %%, and uses %% as the beginning of a comment. cute format, cute handling πŸ“
  • markdown β€” handles some special markup in Markdown-formatted texts. markdown girlies rise πŸ‘‘
  • yfm_keys (markdown-only) β€” comma-separated list of keys to process for translation in the YAML Front Matter section. all other keys are skipped. keys are matched with a case-sensitive match. if yfm_paths and yfm_keys are used together, values are included if they are matched by at least one of the options. array values are always translated, unless the yfm_skip_array option is provided πŸŽ€
  • yfm_lenient (markdown only) β€” allows the YAML Front Matter parser to fail on malformated headers. particularly helpful when your file starts with a horizontal ruler instead of a YAML Front Matter, but you insist on using three dashes only for your ruler. we've all been there 😭
  • yfm_paths (markdown only) β€” comma-separated list of hash paths to process for extraction in the YAML Front Matter section, all other paths are skipped. paths are matched with a case-sensitive match. if yfm_paths and yfm_keys are used together, values are included if they are matched by at least one of the options. arrays values are always returned unless the yfm_skip_array option is provided πŸ’œ
  • yfm_paths β€” yes bestie, it's listed a second time in the source with no parenthetical. same option, same spelling, we're keeping it exactly as it appears. no cap 🫢
  • yfm_skip_array (markdown-only) β€” do not translate array values in the YAML Front Matter section. skip 'em πŸ¦‹
  • control[=field_list] β€” handles Debian's control files. and yes, you can hand it a comma-separated list of fields to be translated. customized translation, we love to see it πŸ’–
  • neverwrap β€” prevents po4a from wrapping any lines. this means every content is handled verbatim, even simple paragraphs. truly the "no thoughts, just vibes, keep my line breaks" option πŸ’€

🌈 STATUS OF THIS MODULE 🌈

tested successfully on simple text files and NEWS.Debian files. she passed the vibe check βœ…βœ¨


πŸ‘‘ AUTHORS πŸ‘‘

  • Nicolas FranΓ§ois <nicolas.francois@centraliens.net> β€” an actual legend 🫢

  • Copyright Β© 2005-2008 Nicolas FRANΓ‡OIS <nicolas.francois@centraliens.net>.
  • Copyright Β© 2008-2009, 2018 Jonas Smedegaard <dr@jones.dk>.
  • Copyright Β© 2020 Martin Quinson <mquinson#debian.org>.

this program is free software; you may redistribute it and/or modify it under the terms of GPL v2.0 or later (see the COPYING file). free software rights, we stan πŸŽ€


and that's the whole page, bestie πŸ₯° this fine piece of documentation is brought to you by perl v5.42.0, dated 2025-07-13, and filed under LOCALE:...EXT.3PM(1). go forth and translate literally everything πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from