PO4A-TRANSLATE.1P(1)
π NAME π
po4a-translate β bestie, it takes a PO file and turns it back into documentation format, no cap β¨
π¦ SYNOPSIS π¦
po4a-translate -f fmt -m master.doc -p XX.po -l XX.doc
Heads up: XX.doc is the output, like, literally everything else is an input π«Ά
πΈ DESCRIPTION πΈ
Okay so the whole po4a (PO for anything) project has one goal, and it's honestly iconic: make translations easier β and even more importantly, make maintaining those translations easier β by using gettext tools on places nobody expected them to go, like documentation. it's giving chaos but make it organized π
The po4a-translate script is the main character here: its whole job is converting the translation (which you did in a PO file) back into the documentation format. And bestie, the PO file you feed it should be the translation of the POT file that po4a-gettextize(1) produced. no substitutions, periodt π₯
β¨ OPTIONS β¨
-f,--formatβ the format of the documentation you wanna handle. not sure which ones exist? run the--help-formatoption and it'll list every available format for you π-a,--addendumβ adds a file to the resulting file (perfect for dropping in the translator's name, or a whole "About this translation" section, for example). The first line of the file you're inserting has to be a PO4A header telling it where to go β check the section HOWTO add extra text to translations inpo4a(7)π-A,--addendum-charsetβ the charset of the addenda. Important: all the addenda should be in the same charset, okay? don't mix and match π-m,--masterβ the file containing the master document you're translating π-M,--master-charsetβ charset of the file containing the document to translate π§-l,--localizedβ the file where the localized (translated) document should be written βοΈ-L,--localized-charsetβ charset of the file containing the localized document π-p,--poβ the file to read the message catalog from π-o,--optionβ extra option(s) passed straight to the format plugin. Each plugin's docs explain which options are valid and what they mean. For example, you could hit the AsciiDoc parser with-o tablecells, while the text parser would accept-o tabs=splitβ-k,--keepβ the minimal translation-percentage threshold for keeping (i.e. writing) the resulting file, default80. So by default, files gotta be at least 80% translated to actually get written. the bar is on the floor but it's still a bar π-w,--widthβ the column to wrap the resulting file at, if the format supports it, default76. And if you pass0or a negative value, the resulting file won't be wrapped at all β which is lowkey useful for formats that break when you rewrap them π«Ά-h,--helpβ shows a short help message, short and sweet π--help-formatβ lists all the documentation formats po4a understands π-V,--versionβ displays the version of the script and exits, bye βοΈ-v,--verboseβ cranks up the verbosity of the program π-d,--debugβ outputs some debugging information, for when you gotta see what's going on inside π§
π Adding content (beside translations) to generated files π
So you want extra content in the generated document beside what you translated? like the translator's name, or an "About this translation" section? The move is the --addendum option, that's literally what it's for π«Ά
The first line of the addendum must be a header saying where to put it in the document β and it can go before or after a given part of the document. The rest of the file gets added verbatim to the resulting file, no further processing, untouched, main character energy β¨
β οΈ Okay this part matters: if po4a-translate fails to add one of the given files, it discards the whole translation. Why so dramatic? Because the missing file could be the one naming the author β which would leave users unable to contact them and report bugs in the translation. so yeah, it's a whole thing π
The header has a pretty rigid syntax, ngl. For more info on how to use this feature and how it actually works, go read the po4a(7) man page π
π¦ SEE ALSO π¦
po4a-gettextize(1), po4a-normalize(1), po4a-updatepo(1), po4a(7)
π AUTHORS π
- Denis Barbier
<barbier@linuxfr.org> - Nicolas FranΓ§ois
<nicolas.francois@centraliens.net> - Martin Quinson (mquinson#debian.org)
π COPYRIGHT AND LICENSE π
Copyright 2002-2023 by SPI, inc.
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).
okay that's the whole page bestie, go translate something iconic πβ¨π
perl v5.42.0 Β· 2025-07-13 β mwah, that's the version and date, catch you on the flip side π«Άπ
π¦ where this page comes from
- alpine 3.23: po4a-doc 0.74-r0 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms