# info > msgen

---
type: CommandReference
command: msgen
mode: info
section: 9.9
source: info
---

## Quick Reference

- `msgen input.po` — create English translation catalog from PO file (untranslated entries get msgid as translation)
- `msgen input.po -o output.po` — specify output file
- `msgen -D dir input.po` — add directory to search path
- `msgen --lang=en input.po` — set Language field in header entry
- `msgen -P file.properties` — assume Java .properties input
- `msgen --stringtable-input file.strings` — assume NeXTstep .strings input
- `msgen --force-po input.po` — write output even if empty
- `msgen --color=always input.po` — enable colored output

## Name

msgen — create an English translation catalog from a PO file or POT file; untranslated entries are assigned a translation identical to the msgid.

## Synopsis

shell
msgen [OPTION] INPUTFILE
Note: `msginit --no-translator --locale=en` performs a similar task but cares specially about the header entry, whereas msgen does not.

## Options

### Input/Output

- `INPUTFILE` — Input PO or POT file; use `-` for standard input
- `-D DIRECTORY, --directory=DIRECTORY` — Add DIRECTORY to the list of directories for source file search; output is relative to current directory
- `-o FILE, --output-file=FILE` — Write output to FILE; default is standard output; use `-` for stdout

### Input Syntax

- `-P, --properties-input` — Assume input is a Java ResourceBundle in .properties syntax
- `--stringtable-input` — Assume input is a NeXTstep/GNUstep .strings file

### Output Formatting

- `--lang=CATALOGNAME` — Set the `Language` field in the header entry; note: `Language-Team` and `Plural-Forms` are not set by this option
- `--color`, `--color=WHEN` — Use colors/text attributes; WHEN can be `always`, `auto`, `never`
- `--style=STYLE_FILE` — CSS style rule file for `--color`
- `--force-po` — Always write output file even if it contains no message
- `-i, --indent` — Write .po file in indented style
- `--no-location` — Do not write `#: FILENAME:LINE` lines
- `-n, --add-location=TYPE` — Generate `#: FILENAME:LINE` lines; TYPE can be `full` (default), `file` (omit line number), or `never` (same as `--no-location`)
- `--strict` — Write strict Uniforum conforming PO file (avoid, no GNU extensions)
- `-p, --properties-output` — Write Java .properties output (no plural forms, drops obsolete messages)
- `--stringtable-output` — Write NeXTstep .strings output (no plural forms)
- `-w NUMBER, --width=NUMBER` — Set output page width; long strings are split to keep line width ≤ NUMBER
- `--no-wrap` — Do not break long message lines (only file reference lines wider than width are split)
- `-s, --sort-output` — Generate sorted output (harder for translators to understand context)
- `-F, --sort-by-file` — Sort output by file location

### Informative

- `-h, --help` — Display help and exit
- `-V, --version` — Output version information and exit

## See Also

- `msgexec(1)`, `msgattrib(1)`, `msginit(1)`, `xgettext(1)`
- GNU gettext manual (info node `(gettext)msgen Invocation`)