msginit β create a new PO file
| Use Case | Command | Description |
|---|---|---|
| Create a PO file from a POT file | msginit -i messages.pot -o lv.po | π Initialize a new PO file for a specific locale (e.g., Latvian) |
| Specify target locale | msginit -l de_DE.UTF-8 | π Set locale to German (Germany) with UTF-8 encoding |
| Mark as machineβgenerated | msginit --no-translator | π€ Declare no human translator; automatic generation |
| Output to standard output | msginit -o - | π€ Write PO file to stdout |
| Use Java properties input | msginit -P -i input.properties | π§ Assume input is Java .properties syntax |
msginit Programmsginit [OPTION]
The msginit program creates a new PO file, initializing the meta information with values from the userβs environment.
The following header fields of a PO file are automatically filled, when possible:
configure script or other files in the current directory.PO-Creation-Date in the input POT file, or current date is used.charset=UTF-8, it means nonβASCII characters are present and UTFβ8 is kept; otherwise, the localeβs encoding is used.msginit to use information from Unicode CLDR by setting the GETTEXTCLDRDIR environment variable. The program will look for a file named common/supplemental/plurals.xml under that directory. You can get the CLDR data from http://cldr.unicode.org/.-i INPUTFILE, --input=INPUTFILE β π Input POT file.If no INPUTFILE is given, the current directory is searched for the POT file. If it is -, standard input is read.
-o FILE, --output-file=FILE β πΎ Write output to specified PO file.If no output file is given, it depends on the --locale option or the userβs locale setting. If it is -, the results are written to standard output.
-P, --properties-input β β Assume the input file is a Java ResourceBundle in Java .properties syntax, not in PO file syntax.--stringtable-input β π Assume the input file is a NeXTstep/GNUstep localized resource file in .strings syntax, not in PO file syntax.-l LL_CC[.ENCODING], --locale=LL_CC[.ENCODING] β π Set target locale. LL should be a language code, CC a country code. The optional part .ENCODING specifies the encoding (most often .UTF-8). The command locale -a lists all installed locales. Default is the userβs locale setting.--no-translator β π€ Declares that the PO file will not have a human translator and is instead automatically generated.--color, --color=WHEN β π¨ Specify whether or when to use colors and other text attributes. See note: The --color option for details.--style=STYLE_FILE β π Specify the CSS style rule file to use for --color. See note: The --style option for details.-p, --properties-output β β Write out a Java ResourceBundle in Java .properties syntax. Note that this file format doesnβt support plural forms and silently drops obsolete messages.--stringtable-output β π Write out a NeXTstep/GNUstep localized resource file in .strings syntax. Note that this file format doesnβt support plural forms.-w NUMBER, --width=NUMBER β π Set the output page width. Long strings in the output files will be split across multiple lines to ensure that each lineβs width (number of screen columns) is β€ the given NUMBER.--no-wrap β π« Do not break long message lines. Message lines wider than the output page width will not be split. Only file reference lines wider than the output page width will be split.-h, --help β β Display this help and exit.-V, --version β βΉ Output version information and exit.Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 08:47 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format