MSGFMT(1) User Commands MSGFMT(1)

# [NAME](#NAME)

msgfmt - compile message catalog to binary format

# [SYNOPSIS](#SYNOPSIS)

**msgfmt** \[*OPTION*] *filename.po* ...

# [DESCRIPTION](#DESCRIPTION)

Generate binary message catalog from textual translation description.

Mandatory arguments to long options are mandatory for short options too. Similarly for optional arguments.

## [Input file location:](#Input_file_location:)

[filename.po ...](#filename.po)

input files

[**-D**, **--directory**=*DIRECTORY*](#D)

add DIRECTORY to list for input files search

If input file is -, standard input is read.

## [Operation mode:](#Operation_mode:)

[**-j**, **--java**](#j)

Java mode: generate a Java ResourceBundle class

[**--java2**](#java2)

like **--java**, and assume Java2 (JDK 1.2 or higher)

[**--csharp**](#csharp)

C# mode: generate a .NET .dll file

[**--csharp-resources**](#csharp~2)

C# resources mode: generate a .NET .resources file

[**--tcl**](#tcl)

Tcl mode: generate a tcl/msgcat .msg file

[**--qt**](#qt)

Qt mode: generate a Qt .qm file

[**--desktop**](#desktop)

Desktop Entry mode: generate a .desktop file

[**--xml**](#xml)

XML mode: generate XML file

## [Output file location:](#Output_file_location:)

[**-o**, **--output-file**=*FILE*](#o)

write output to specified file

[**--strict**](#strict)

enable strict Uniforum mode

If output file is -, output is written to standard output.

## [Output file location in Java mode:](#Output_file_location_in_Java_mode:)

[**-r**, **--resource**=*RESOURCE*](#r)

resource name

[**-l**, **--locale**=*LOCALE*](#l)

locale name, either language or language\_COUNTRY

[**--source**](#source)

produce a .java file, instead of a .class file

[**-d** DIRECTORY](#d)

base directory of classes directory hierarchy

The class name is determined by appending the locale name to the resource name, separated with an underscore. The **-d** option is mandatory. The class is written under the specified directory.

## [Output file location in C# mode:](#Output_file_location_in_C__mode:)

[**-r**, **--resource**=*RESOURCE*](#r~2)

resource name

[**-l**, **--locale**=*LOCALE*](#l~2)

locale name, either language or language\_COUNTRY

[**-d** DIRECTORY](#d~2)

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 whose name depends on the locale.

## [Output file location in Tcl mode:](#Output_file_location_in_Tcl_mode:)

[**-l**, **--locale**=*LOCALE*](#l~3)

locale name, either language or language\_COUNTRY

[**-d** DIRECTORY](#d~3)

base directory of .msg message catalogs

The **-l** and **-d** options are mandatory. The .msg file is written in the specified directory.

## [Desktop Entry mode options:](#Desktop_Entry_mode_options:)

[**-l**, **--locale**=*LOCALE*](#l~4)

locale name, either language or language\_COUNTRY

[**-o**, **--output-file**=*FILE*](#o~2)

write output to specified file

[**--template**=*TEMPLATE*](#template)

a .desktop file used as a template

[**-d** DIRECTORY](#d~4)

base directory of .po files

[**-kWORD**, **--keyword**=*WORD*](#kWORD)

look for WORD as an additional keyword

[**-k**, **--keyword**](#k)

do not to use default keywords

The **-l**, **-o**, and **--template** options are mandatory. If **-D** is specified, input files are read from the directory instead of the command line arguments.

## [XML mode options:](#XML_mode_options:)

[**-l**, **--locale**=*LOCALE*](#l~5)

locale name, either language or language\_COUNTRY

[**-L**, **--language**=*NAME*](#L)

recognise the specified XML language

[**-o**, **--output-file**=*FILE*](#o~3)

write output to specified file

[**--template**=*TEMPLATE*](#template~2)

an XML file used as a template

[**-d** DIRECTORY](#d~5)

base directory of .po files

[**--replace-text**](#replace)

output XML with translated text replacing the original text, not augmenting the original text

The **-l**, **-o**, and **--template** options are mandatory. If **-D** is specified, input files are read from the directory instead of the command line arguments.

## [Input file syntax:](#Input_file_syntax:)

[**-P**, **--properties-input**](#P)

input files are in Java .properties syntax

[**--stringtable-input**](#stringtable)

input files are in NeXTstep/GNUstep .strings syntax

## [Input file interpretation:](#Input_file_interpretation:)

[**-c**, **--check**](#c)

perform all the checks implied by **--check-format**, **--check-header**, **--check-domain**

[**--check-format**](#check)

check language dependent format strings

[**--check-header**](#check~2)

verify presence and contents of the header entry

[**--check-domain**](#check~3)

check for conflicts between domain directives and the **--output-file** option

[**-C**, **--check-compatibility**](#C)

check that GNU msgfmt behaves like X/Open msgfmt

[**--check-accelerators**\[=*CHAR*\]](#check~4)

check presence of keyboard accelerators for menu items

[**-f**, **--use-fuzzy**](#f)

use fuzzy entries in output

## [Output details:](#Output_details:)

[**--no-convert**](#no)

don't convert the messages to UTF-8 encoding

[**--no-redundancy**](#no~2)

don't pre-expand ISO C 99 &lt;inttypes.h&gt; format string directive macros

[**-a**, **--alignment**=*NUMBER*](#a)

align strings to NUMBER bytes (default: 1)

[**--endianness**=*BYTEORDER*](#endianness)

write out 32-bit numbers in the given byte order (big or little, default depends on platform)

[**--no-hash**](#no~3)

binary file will not include the hash table

## [Informative output:](#Informative_output:)

[**-h**, **--help**](#h)

display this help and exit

[**-V**, **--version**](#V)

output version information and exit

[**--statistics**](#statistics)

print statistics about translations

[**-v**, **--verbose**](#v)

increase verbosity level

# [AUTHOR](#AUTHOR)

Written by Ulrich Drepper, Bruno Haible, and Daiki Ueno.

# [REPORTING BUGS](#REPORTING_BUGS)

Report bugs in the bug tracker at &lt;https://savannah.gnu.org/projects/gettext&gt; or by email to &lt;bug-gettext@gnu.org&gt;.

# [COPYRIGHT](#COPYRIGHT)

Copyright © 1995-2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;https://gnu.org/licenses/gpl.html&gt;  
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

# [SEE ALSO](#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.

October 2026 GNU gettext-tools 1.0

---

Document: msgfmt(1) from gettext 1.0-r8 (Chainguard OS)
Source: https://git.savannah.gnu.org/git/gettext.git
