MSGFMT(1)
๐ธ NAME ๐ธ
msgfmt โ compile message catalog to binary format ๐
โจ
๐ SYNOPSIS ๐
msgfmt [OPTION] filename.po ...
๐ DESCRIPTION ๐
So basically, msgfmt generates a binary message catalog out of a textual translation description. It's giving "glow-up machine for your .po files," and honestly? Iconic. ๐ฆ
Heads up bestie: mandatory arguments to long options are mandatory for short options too. Same energy for optional arguments. No exceptions, fr fr.
๐ง Input file location:
filename.po ...โ the input files, obviously ๐-D,--directory=DIRECTORYโ addDIRECTORYto the list it searches for input files
And if an input file is literally just -? Then standard input is read instead. Cute, right? ๐
โญ Operation mode:
-j,--javaโ Java mode: generate a JavaResourceBundleclass โ--java2โ same as--java, except it assumes Java2 (JDK 1.2 or higher, bestie, we're not living in the past)--csharpโ C# mode: generate a .NET.dllfile--csharp-resourcesโ C# resources mode: generate a .NET.resourcesfile--tclโ Tcl mode: generate a tcl/msgcat.msgfile--qtโ Qt mode: generate a Qt.qmfile--desktopโ Desktop Entry mode: generate a.desktopfile--xmlโ XML mode: generate an XML file
๐ Output file location:
-o,--output-file=FILEโ write the output to the specified file--strictโ enable strict Uniforum mode ๐
If the output file is -, the output gets written to standard output. Streams, slay. ๐
๐ฆ Output file location in Java mode:
-r,--resource=RESOURCEโ resource name-l,--locale=LOCALEโ locale name, either language or language_COUNTRY--sourceโ produce a.javafile, instead of a.classfile-d DIRECTORYโ base directory of the classes directory hierarchy
So the class name gets determined by appending the locale name to the resource name, separated with an underscore. The -d option is mandatory โ not optional, bestie, mandatory. And the class is written under the specified directory. ๐ซ
๐ธ Output file location in C# mode:
-r,--resource=RESOURCEโ resource name-l,--locale=LOCALEโ locale name, either language or language_COUNTRY-d DIRECTORYโ base directory for locale dependent.dllfiles
The -l and -d options are mandatory. The .dll file is written in a subdirectory of the specified directory, and that subdirectory's name depends on the locale. Cute little nesting situation going on. ๐ซถ
๐ง Output file location in Tcl mode:
-l,--locale=LOCALEโ locale name, either language or language_COUNTRY-d DIRECTORYโ base directory of.msgmessage catalogs
The -l and -d options are mandatory. The .msg file is written in the specified directory. Periodt. ๐
โจ Desktop Entry mode options:
-l,--locale=LOCALEโ locale name, either language or language_COUNTRY-o,--output-file=FILEโ write the output to the specified file--template=TEMPLATEโ a.desktopfile used as a template-d DIRECTORYโ base directory of.pofiles-kWORD,--keyword=WORDโ look forWORDas an additional keyword-k,--keywordโ do not to use default keywords
The -l, -o, and --template options are mandatory. And if -D is specified, input files get read from the directory instead of the command line arguments. Plot twist! ๐
๐ฅ XML mode options:
-l,--locale=LOCALEโ locale name, either language or language_COUNTRY-L,--language=NAMEโ recognise the specified XML language-o,--output-file=FILEโ write the output to the specified file--template=TEMPLATEโ an XML file used as a template-d DIRECTORYโ base directory of.pofiles--replace-textโ output XML with translated text replacing the original text, not augmenting the original text
The -l, -o, and --template options are mandatory. And again โ if -D is specified, input files are read from the directory instead of the command line arguments. ๐
๐ Input file syntax:
-P,--properties-inputโ input files are in Java.propertiessyntax--stringtable-inputโ input files are in NeXTstep/GNUstep.stringssyntax
๐ Input file interpretation:
-c,--checkโ perform all the checks implied by--check-format,--check-header,--check-domain--check-formatโ check language dependent format strings--check-headerโ verify presence and contents of the header entry--check-domainโ check for conflicts between domain directives and the--output-fileoption-C,--check-compatibilityโ check that GNUmsgfmtbehaves like X/Openmsgfmt--check-accelerators[=CHAR]โ check presence of keyboard accelerators for menu items-f,--use-fuzzyโ use fuzzy entries in output
๐ Output details:
--no-convertโ don't convert the messages to UTF-8 encoding--no-redundancyโ don't pre-expand ISO C 99<inttypes.h>format string directive macros-a,--alignment=NUMBERโ align strings toNUMBERbytes (default:1)--endianness=BYTEORDERโ write out 32-bit numbers in the given byte order (big or little, default depends on platform)--no-hashโ binary file will not include the hash table
๐ Informative output:
-h,--helpโ display this help and exit-V,--versionโ output version information and exit--statisticsโ print statistics about translations-v,--verboseโ increase verbosity level
๐ซ AUTHOR ๐ซ
Written by Ulrich Drepper, Bruno Haible, and Daiki Ueno. Absolute legends, no cap. ๐
๐ญ REPORTING BUGS ๐ญ
Found a bug? Don't suffer in silence, bestie. Report bugs in the bug tracker at <https://savannah.gnu.org/projects/gettext> or by email to <bug-gettext@gnu.org>.
๐ COPYRIGHT ๐
Copyright ยฉ 1995-2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (That's the dramatic part, don't skip it. ๐)
๐ฆ SEE ALSO ๐ฆ
The full documentation for msgfmt is maintained as a Texinfo manual. If the info and msgfmt programs are properly installed at your site, the command
info msgfmt
should give you access to the complete manual. Go read it, it's giving main character energy. โจ
GNU gettext-tools 1.0 ๐ธ January 2026 ๐ธ that's the whole MSGFMT(1) page, bestie โ go compile something beautiful ๐ ๐
๐ฆ where this page comes from
- alpine 3.24: gettext-doc 1.0-r0 ยท GPL-3.0-or-later AND LGPL-2.1-or-later AND MIT
- arch rolling: gettext 1.0-2 ยท GFDL-1.2-only AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.0-only
- nixos 26.05: gettext 1.0
- nixpkgs unstable: gettext 1.0
- ubuntu stonking: gettext 1.0-3 ยท 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