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 โ€” add DIRECTORY to 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 Java ResourceBundle class โ˜•
  • --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 .dll file
  • --csharp-resources โ€” C# resources mode: generate a .NET .resources file
  • --tcl โ€” Tcl mode: generate a tcl/msgcat .msg file
  • --qt โ€” Qt mode: generate a Qt .qm file
  • --desktop โ€” Desktop Entry mode: generate a .desktop file
  • --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 .java file, instead of a .class file
  • -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 .dll files

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 .msg message 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 .desktop file used as a template
  • -d DIRECTORY โ€” base directory of .po files
  • -kWORD, --keyword=WORD โ€” look for WORD as 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 .po files
  • --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 .properties syntax
  • --stringtable-input โ€” input files are in NeXTstep/GNUstep .strings syntax

๐Ÿ‘‘ 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-file option
  • -C, --check-compatibility โ€” check that GNU msgfmt behaves like X/Open msgfmt
  • --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 to NUMBER bytes (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 ยฉ 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