Skip to content
Novus Examples
po2 KB

gettext PO — fuzzy, obsolete and untranslated entries

A German catalog carrying every state a PO entry can be in but the happy one: two fuzzy entries (one of them a plural) with #| previous-msgid comments, an entry that is present but untranslated, three obsolete #~ entries including an obsolete plural and an obsolete msgctxt entry, and two complete entries as the control.

Preview — first 50 linespo
# German translation for the Novus example file manager.
# Sample Translator <translator@example.invalid>, 2026.
#
msgid ""
msgstr ""
"Project-Id-Version: novus-example 2.0\n"
"POT-Creation-Date: 2026-01-01 00:00+0000\n"
"PO-Revision-Date: 2026-01-02 12:00+0000\n"
"Last-Translator: Sample Translator <translator@example.invalid>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. A normal, complete entry — this one compiles.
#: src/browser.c:42
msgid "Files"
msgstr "Dateien"

#. A FUZZY entry. msgfmt omits it from the .mo unless --use-fuzzy is passed, so the runtime
#. falls back to the untranslated msgid. The #| line records the msgid this translation was
#. originally written against, which is how a translator sees what changed.
#: src/browser.c:207
#, fuzzy
#| msgid "Move to bin"
msgid "Move to trash"
msgstr "In den Papierkorb verschieben"

#. A fuzzy PLURAL entry: both forms are present but the whole entry is still skipped.
#: src/browser.c:118
#, fuzzy, c-format
#| msgid "%d document"
#| msgid_plural "%d documents"
msgid "%d file"
msgid_plural "%d files"
msgstr[0] "%d Datei"
msgstr[1] "%d Dateien"

#. A complete, non-fuzzy plural entry — the control case that MUST reach the .mo.
#: src/trash.c:73
#, c-format
msgid "Deleted %d item"
msgid_plural "Deleted %d items"
msgstr[0] "%d Element gelöscht"
msgstr[1] "%d Elemente gelöscht"

#. An untranslated entry: present, empty, and NOT fuzzy.
#: src/browser.c:164
#, c-format
69 lines total — download for the full file.

Specifications

Locale
de
Language
German
Fuzzy Entries
2
Obsolete Entries
3
Untranslated Entries
1
Complete Entries
2
Features
#, fuzzy | #| previous msgid | #~ obsolete | empty msgstr
Charset
UTF-8
Seed
20260807
Wave
p7
Line Endings
LF

Testing contract

Expected to pass
Scenario
Run msgfmt without --use-fuzzy, then with it, and compare the resulting catalogs; separately, parse the file and classify every entry.
Expected result
Without --use-fuzzy the compiled catalog contains exactly the two complete entries; with it, four. The #~ entries never compile under either flag, and the untranslated entry must not be reported as translated-to-empty-string.

What is a .po file?

A PO file (.po, Portable Object) is a gettext translation catalog: a plain-text list of msgid (source string) and msgstr (translation) pairs, with a header defining the language and plural rules, source-location comments, and support for plural forms. It is the working file translators edit and is compiled to a binary .mo for runtime.

How to use this file

Use an example .po file to test gettext parsers, PO editors and CAT tools, translation-memory importers, and PO-to-JSON/XLIFF converters, or to exercise plural-form handling.

How to use this file for testing

“gettext PO — fuzzy, obsolete and untranslated entries” is a deterministic Novus Examples fixture for Internationalization, Localization catalogs, Error handling. Parallel text and accented, multi-script content — for testing translation pipelines, Unicode handling, and localization tooling.

Documented properties for this file: seed 20260807 · German · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Translation-catalog fixtures carry the same message set across formats, each with its native placeholder syntax. Test your i18n loader, catalog converter, or translation-memory tool, and use the RTL and CJK variants to check bidirectional text and Unicode handling.

Load the catalog with your i18n framework and verify placeholder interpolation and plural handling; the RTL and CJK variants exercise bidirectional text and font fallback.

Code examples

import polib  # pip install polib

po = polib.pofile("fuzzy-obsolete-de.po")
print(len(po), "entries,", round(po.percent_translated()), "% translated")
for e in po[:3]:
    print(e.msgid, "->", e.msgstr)

Generated by generation/localization_p7.py. Free for any use, no attribution required — license.