ITSTOOL(1)
π ITSTOOL β okay bestie, let's talk β¨
So like, itstool is the little command-line icon from the General Commands Manual crew, and she's here to convert between XML and PO using ITS. That's the whole vibe. Fr fr.
π¦ SYNOPSIS π¦
itstool [OPTIONS] XMLFILES...
itstool -m <MOFILE> [OPTIONS] XMLFILES...
itstool -j <XMLFILE> [OPTIONS] MOFILES...
Three whole modes. Pick your fighter. π
β¨ DESCRIPTION β¨
Okay so here's the tea, bestie: itstool extracts messages from XML files and outputs PO template files, and then it merges translations from MO files to create translated XML files. Iconic behaviour honestly.
The way it knows what to translate and how to chunk it into messages? It uses the W3C Internationalization Tag Set (ITS). That's the secret sauce. No cap. π§
Wanna extract messages from XML files XMLFILES and dump them into OUT.pot? Say less:
itstool -o OUT.pot XMLFILES
Then after you merge with existing translations (or translate the strings yourself, main character energy), generate an MO file with msgfmt(1), and then output the translated files into the directory DIR:
itstool -m OUT.mo -o DIR XMLFILES
And if you want a single multilingual XML output file β like, one file, all the languages β you can use an input XML file plus a set of MO files:
itstool -j FILE.xml -o OUT.xml MOFILES
Now, where do ITS definitions come from? Great question, I'm so glad you asked. π«Ά They get loaded from:
- the built-in rules
- rules embedded in the source XML files
- files passed with the
-ioption - ITS attributes in the source XML files
And here's the important bit: later definitions take precedence. So the order matters, bestie. And if you're feeling rebellious, you can disable the built-in rules entirely by passing -n. Periodt. π
π OPTIONS π
πΈ Extracting
-o OUT.pot,--out OUT.potβ output PO template to the fileOUT.pot
π¦ Merging
-m MOFILE XMLFILES,--merge MOFILE XMLFILESβ merge from an MO fileMOFILEand output translated XML files for sourceXMLFILES-l LANG,--lang LANGβ explicitly set the language code output to XML-o OUT,--out OUTβ output XML files in the directoryOUT
π Joining
-j MLIFILE MOFILES,--join XMLFILE MOFILESβ join translations fromMOFILESinto a multilingual file based on sourceXMLFILE-o OUT.xml,--out OUT.xmlβ output to the XML fileOUT.xml
β Common
-i ITS,--its ITSβ load the ITS rules in the fileITS(can specify multiple times)-n,--no-builtinsβ do not apply the built-in ITS rules that ship withitstool-s,--strictβ exit with error when PO files contain broken XML-d,--load-dtdβ load external DTDs used by input XML files-k,--keep-entitiesβ keep entity references unexpanded in PO files-p NAME VALUE,--param NAME VALUEβ define ITS parameterNAMEto the valueVALUE(can specify multiple times)
Lowkey note:-iand-pcan both be specified multiple times. Stack 'em up, bestie. π
π AUTHOR π
Shaun McCance <shaunm@gnome.org> β the legend, the blueprint, the moment. π
π SEE ALSO π
More documentation for itstool is maintained online. For more information, see:
http://itstool.org/documentation/
And that's the whole page, bestie! This lil masterpiece is from itstool 2.0.7, dated December 2013, and she lives in the ITSTOOL(1) section of the manual. Go translate something gorgeous, mwah. πβ¨π
π¦ where this page comes from
- alpine 3.22: itstool-doc 2.0.7-r2 Β· GPL-3.0-or-later
- alpine 3.23: itstool-doc 2.0.7-r3 Β· GPL-3.0-or-later
- alpine 3.24: itstool-doc 2.0.7-r3 Β· GPL-3.0-or-later
- centos-stream 10: itstool 2.0.7-10.el10 Β· GPL-3.0-or-later
- fedora 43: itstool 2.0.7-11.fc43 Β· GPL-3.0-or-later
- fedora 44: itstool 2.0.7-12.fc44 Β· GPL-3.0-or-later
- nixos 26.05: itstool 2.0.7
- nixpkgs unstable: itstool 2.0.7
- opensuse-leap 16.0: itstool 2.0.7-160000.2.2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms