DEV Community

Cover image for What msgfmt --check rejects in a .po file
Georgi Kalchev
Georgi Kalchev

Posted on Originally published at aiskills402.com

What msgfmt --check rejects in a .po file

A .po file stops compiling when format flags, the plural header, escapes or duplicate keys disagree. What msgfmt checks, and what to leave alone.

A .po file is a catalog of source strings with their translations, and the build step that turns it into a binary catalog is msgfmt. With the checking switch on, that program refuses a file for a short list of reasons: the format placeholders of a string and its translation disagree, the number of plural lines does not fit the header, the header has no usable plural rule, an escape sequence is unknown, the same key is defined twice, or the declared character set is not a real one. Some things that look like errors are accepted without a word, an empty translation and an entry marked fuzzy among them. This guide goes through each rejection, shows what it looks like when it happens, and…

Read the full report on AISkills402: https://aiskills402.com/blog/gettext-po-msgfmt-check-errors?utm_source=devto&utm_medium=social

Top comments (0)