{
    "mode": "man",
    "parameter": "MSGFMT",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/MSGFMT/1/json",
    "generated": "2026-06-13T21:01:27Z",
    "synopsis": "msgfmt [OPTION] filename.po ...",
    "sections": {
        "NAME": {
            "content": "msgfmt - compile message catalog to binary format\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "msgfmt [OPTION] filename.po ...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Generate binary message catalog from textual translation description.\n\nMandatory  arguments  to long options are mandatory for short options too.  Similarly for op‐\ntional arguments.\n",
            "subsections": [
                {
                    "name": "Input file location:",
                    "content": "filename.po ...\ninput files\n"
                },
                {
                    "name": "-D --directory",
                    "content": "add DIRECTORY to list for input files search\n\nIf input file is -, standard input is read.\n",
                    "flag": "-D",
                    "long": "--directory"
                },
                {
                    "name": "Operation mode:",
                    "content": ""
                },
                {
                    "name": "-j --java",
                    "content": "Java mode: generate a Java ResourceBundle class\n",
                    "flag": "-j",
                    "long": "--java"
                },
                {
                    "name": "--java2",
                    "content": "like --java, and assume Java2 (JDK 1.2 or higher)\n",
                    "long": "--java2"
                },
                {
                    "name": "--csharp",
                    "content": "C# mode: generate a .NET .dll file\n",
                    "long": "--csharp"
                },
                {
                    "name": "--csharp-resources",
                    "content": "C# resources mode: generate a .NET .resources file\n\n--tcl  Tcl mode: generate a tcl/msgcat .msg file\n\n--qt   Qt mode: generate a Qt .qm file\n",
                    "long": "--csharp-resources"
                },
                {
                    "name": "--desktop",
                    "content": "Desktop Entry mode: generate a .desktop file\n\n--xml  XML mode: generate XML file\n",
                    "long": "--desktop"
                },
                {
                    "name": "Output file location:",
                    "content": ""
                },
                {
                    "name": "-o --output-file",
                    "content": "write output to specified file\n",
                    "flag": "-o",
                    "long": "--output-file"
                },
                {
                    "name": "--strict",
                    "content": "enable strict Uniforum mode\n\nIf output file is -, output is written to standard output.\n",
                    "long": "--strict"
                },
                {
                    "name": "Output file location in Java mode:",
                    "content": ""
                },
                {
                    "name": "-r --resource",
                    "content": "resource name\n",
                    "flag": "-r",
                    "long": "--resource"
                },
                {
                    "name": "-l --locale",
                    "content": "locale name, either language or languageCOUNTRY\n",
                    "flag": "-l",
                    "long": "--locale"
                },
                {
                    "name": "--source",
                    "content": "produce a .java file, instead of a .class file\n",
                    "long": "--source"
                },
                {
                    "name": "-d",
                    "content": "base directory of classes directory hierarchy\n\nThe class name is determined by appending the locale name to  the  resource  name,  separated\nwith  an  underscore.   The -d option is mandatory.  The class is written under the specified\ndirectory.\n",
                    "flag": "-d"
                },
                {
                    "name": "Output file location in C# mode:",
                    "content": ""
                },
                {
                    "name": "-r --resource",
                    "content": "resource name\n",
                    "flag": "-r",
                    "long": "--resource"
                },
                {
                    "name": "-l --locale",
                    "content": "locale name, either language or languageCOUNTRY\n",
                    "flag": "-l",
                    "long": "--locale"
                },
                {
                    "name": "-d",
                    "content": "base directory for locale dependent .dll files\n\nThe -l and -d options are mandatory.  The .dll file is written in a subdirectory of the spec‐\nified directory whose name depends on the locale.\n",
                    "flag": "-d"
                },
                {
                    "name": "Output file location in Tcl mode:",
                    "content": ""
                },
                {
                    "name": "-l --locale",
                    "content": "locale name, either language or languageCOUNTRY\n",
                    "flag": "-l",
                    "long": "--locale"
                },
                {
                    "name": "-d",
                    "content": "base directory of .msg message catalogs\n\nThe -l and -d options are mandatory.  The .msg file is written in the specified directory.\n",
                    "flag": "-d"
                },
                {
                    "name": "Desktop Entry mode options:",
                    "content": ""
                },
                {
                    "name": "-l --locale",
                    "content": "locale name, either language or languageCOUNTRY\n",
                    "flag": "-l",
                    "long": "--locale"
                },
                {
                    "name": "-o --output-file",
                    "content": "write output to specified file\n\n--template=TEMPLATE\na .desktop file used as a template\n",
                    "flag": "-o",
                    "long": "--output-file"
                },
                {
                    "name": "-d",
                    "content": "base directory of .po files\n",
                    "flag": "-d"
                },
                {
                    "name": "-kWORD --keyword",
                    "content": "look for WORD as an additional keyword\n",
                    "long": "--keyword"
                },
                {
                    "name": "-k --keyword",
                    "content": "do not to use default keywords\n\nThe  -l,  -o, and --template options are mandatory.  If -D is specified, input files are read\nfrom the directory instead of the command line arguments.\n",
                    "flag": "-k",
                    "long": "--keyword"
                },
                {
                    "name": "XML mode options:",
                    "content": ""
                },
                {
                    "name": "-l --locale",
                    "content": "locale name, either language or languageCOUNTRY\n",
                    "flag": "-l",
                    "long": "--locale"
                },
                {
                    "name": "-L --language",
                    "content": "recognise the specified XML language\n",
                    "flag": "-L",
                    "long": "--language"
                },
                {
                    "name": "-o --output-file",
                    "content": "write output to specified file\n\n--template=TEMPLATE\nan XML file used as a template\n",
                    "flag": "-o",
                    "long": "--output-file"
                },
                {
                    "name": "-d",
                    "content": "base directory of .po files\n\nThe -l, -o, and --template options are mandatory.  If -D is specified, input files  are  read\nfrom the directory instead of the command line arguments.\n",
                    "flag": "-d"
                },
                {
                    "name": "Input file syntax:",
                    "content": ""
                },
                {
                    "name": "-P --properties-input",
                    "content": "input files are in Java .properties syntax\n",
                    "flag": "-P",
                    "long": "--properties-input"
                },
                {
                    "name": "--stringtable-input",
                    "content": "input files are in NeXTstep/GNUstep .strings syntax\n",
                    "long": "--stringtable-input"
                },
                {
                    "name": "Input file interpretation:",
                    "content": ""
                },
                {
                    "name": "-c --check",
                    "content": "perform all the checks implied by --check-format, --check-header, --check-domain\n",
                    "flag": "-c",
                    "long": "--check"
                },
                {
                    "name": "--check-format",
                    "content": "check language dependent format strings\n",
                    "long": "--check-format"
                },
                {
                    "name": "--check-header",
                    "content": "verify presence and contents of the header entry\n",
                    "long": "--check-header"
                },
                {
                    "name": "--check-domain",
                    "content": "check for conflicts between domain directives and the --output-file option\n",
                    "long": "--check-domain"
                },
                {
                    "name": "-C --check-compatibility",
                    "content": "check that GNU msgfmt behaves like X/Open msgfmt\n\n--check-accelerators[=CHAR]\ncheck presence of keyboard accelerators for menu items\n",
                    "flag": "-C",
                    "long": "--check-compatibility"
                },
                {
                    "name": "-f --use-fuzzy",
                    "content": "use fuzzy entries in output\n",
                    "flag": "-f",
                    "long": "--use-fuzzy"
                },
                {
                    "name": "Output details:",
                    "content": ""
                },
                {
                    "name": "-a --alignment",
                    "content": "align strings to NUMBER bytes (default: 1)\n\n--endianness=BYTEORDER\nwrite  out  32-bit  numbers in the given byte order (big or little, default depends on\nplatform)\n",
                    "flag": "-a",
                    "long": "--alignment"
                },
                {
                    "name": "--no-hash",
                    "content": "binary file will not include the hash table\n",
                    "long": "--no-hash"
                },
                {
                    "name": "Informative output:",
                    "content": ""
                },
                {
                    "name": "-h --help",
                    "content": "display this help and exit\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-V --version",
                    "content": "output version information and exit\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "--statistics",
                    "content": "print statistics about translations\n",
                    "long": "--statistics"
                },
                {
                    "name": "-v --verbose",
                    "content": "increase verbosity level\n",
                    "flag": "-v",
                    "long": "--verbose"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Ulrich Drepper.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "Report bugs in the bug tracker at <https://savannah.gnu.org/projects/gettext> or by email  to\n<bug-gettext@gnu.org>.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright  ©  1995-2020  Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or\nlater <https://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "The  full documentation for msgfmt is maintained as a Texinfo manual.  If the info and msgfmt\nprograms are properly installed at your site, the command\n\ninfo msgfmt\n\nshould give you access to the complete manual.\n\n\n\nGNU gettext-tools 0.21                       March 2022                                    MSGFMT(1)",
            "subsections": []
        }
    },
    "summary": "msgfmt - compile message catalog to binary format",
    "flags": [
        {
            "flag": "-D",
            "long": "--directory",
            "arg": null,
            "description": "add DIRECTORY to list for input files search If input file is -, standard input is read."
        },
        {
            "flag": "-j",
            "long": "--java",
            "arg": null,
            "description": "Java mode: generate a Java ResourceBundle class"
        },
        {
            "flag": "",
            "long": "--java2",
            "arg": null,
            "description": "like --java, and assume Java2 (JDK 1.2 or higher)"
        },
        {
            "flag": "",
            "long": "--csharp",
            "arg": null,
            "description": "C# mode: generate a .NET .dll file"
        },
        {
            "flag": "",
            "long": "--csharp-resources",
            "arg": null,
            "description": "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"
        },
        {
            "flag": "",
            "long": "--desktop",
            "arg": null,
            "description": "Desktop Entry mode: generate a .desktop file --xml XML mode: generate XML file"
        },
        {
            "flag": "-o",
            "long": "--output-file",
            "arg": null,
            "description": "write output to specified file"
        },
        {
            "flag": "",
            "long": "--strict",
            "arg": null,
            "description": "enable strict Uniforum mode If output file is -, output is written to standard output."
        },
        {
            "flag": "-r",
            "long": "--resource",
            "arg": null,
            "description": "resource name"
        },
        {
            "flag": "-l",
            "long": "--locale",
            "arg": null,
            "description": "locale name, either language or languageCOUNTRY"
        },
        {
            "flag": "",
            "long": "--source",
            "arg": null,
            "description": "produce a .java file, instead of a .class file"
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-r",
            "long": "--resource",
            "arg": null,
            "description": "resource name"
        },
        {
            "flag": "-l",
            "long": "--locale",
            "arg": null,
            "description": "locale name, either language or languageCOUNTRY"
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "base directory for locale dependent .dll files The -l and -d options are mandatory. The .dll file is written in a subdirectory of the spec‐ ified directory whose name depends on the locale."
        },
        {
            "flag": "-l",
            "long": "--locale",
            "arg": null,
            "description": "locale name, either language or languageCOUNTRY"
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "base directory of .msg message catalogs The -l and -d options are mandatory. The .msg file is written in the specified directory."
        },
        {
            "flag": "-l",
            "long": "--locale",
            "arg": null,
            "description": "locale name, either language or languageCOUNTRY"
        },
        {
            "flag": "-o",
            "long": "--output-file",
            "arg": null,
            "description": "write output to specified file --template=TEMPLATE a .desktop file used as a template"
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "base directory of .po files"
        },
        {
            "flag": "",
            "long": "--keyword",
            "arg": null,
            "description": "look for WORD as an additional keyword"
        },
        {
            "flag": "-k",
            "long": "--keyword",
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-l",
            "long": "--locale",
            "arg": null,
            "description": "locale name, either language or languageCOUNTRY"
        },
        {
            "flag": "-L",
            "long": "--language",
            "arg": null,
            "description": "recognise the specified XML language"
        },
        {
            "flag": "-o",
            "long": "--output-file",
            "arg": null,
            "description": "write output to specified file --template=TEMPLATE an XML file used as a template"
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "base directory of .po files 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."
        },
        {
            "flag": "-P",
            "long": "--properties-input",
            "arg": null,
            "description": "input files are in Java .properties syntax"
        },
        {
            "flag": "",
            "long": "--stringtable-input",
            "arg": null,
            "description": "input files are in NeXTstep/GNUstep .strings syntax"
        },
        {
            "flag": "-c",
            "long": "--check",
            "arg": null,
            "description": "perform all the checks implied by --check-format, --check-header, --check-domain"
        },
        {
            "flag": "",
            "long": "--check-format",
            "arg": null,
            "description": "check language dependent format strings"
        },
        {
            "flag": "",
            "long": "--check-header",
            "arg": null,
            "description": "verify presence and contents of the header entry"
        },
        {
            "flag": "",
            "long": "--check-domain",
            "arg": null,
            "description": "check for conflicts between domain directives and the --output-file option"
        },
        {
            "flag": "-C",
            "long": "--check-compatibility",
            "arg": null,
            "description": "check that GNU msgfmt behaves like X/Open msgfmt --check-accelerators[=CHAR] check presence of keyboard accelerators for menu items"
        },
        {
            "flag": "-f",
            "long": "--use-fuzzy",
            "arg": null,
            "description": "use fuzzy entries in output"
        },
        {
            "flag": "-a",
            "long": "--alignment",
            "arg": null,
            "description": "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)"
        },
        {
            "flag": "",
            "long": "--no-hash",
            "arg": null,
            "description": "binary file will not include the hash table"
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "display this help and exit"
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        },
        {
            "flag": "",
            "long": "--statistics",
            "arg": null,
            "description": "print statistics about translations"
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "increase verbosity level"
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Compile message catalog to binary format.",
        "examples": [
            {
                "description": "Compile a file to `messages.mo`",
                "command": "msgfmt {{file.po}}"
            },
            {
                "description": "Convert a `.po` file to a `.mo` file",
                "command": "msgfmt {{path/to/file.po}} {{-o|--output-file}} {{path/to/file.mo}}"
            },
            {
                "description": "Display help",
                "command": "msgfmt {{-h|--help}}"
            }
        ]
    }
}