Skip to content
Novus Examples
po1.9 KB

gettext PO with Plural-Forms — Russian (nplurals=3)

A Russian gettext catalog with a real Plural-Forms header and 3 msgstr[] forms per plural entry, source-location and extracted comments, and c-format flags. Pairs with the compiled .mo of the same content, so a loader can be tested end to end rather than on the text format alone.

Preview — first 50 linespo
# Russian translation for the Novus example file manager.
# Copyright (C) 2026 Novus Examples (sample fixture).
# This file is distributed under the same license as the novus-example package.
# Sample Translator <translator@example.invalid>, 2026.
#
msgid ""
msgstr ""
"Project-Id-Version: novus-example 2.0\n"
"Report-Msgid-Bugs-To: i18n@example.invalid\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-Team: Russian <team@example.invalid>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
"X-Generator: novus-examples localization_p7\n"

#. Window title for the file browser
#: src/browser.c:42
msgid "Files"
msgstr "Файлы"

#. Context-menu item
#: src/browser.c:207
msgid "Move to trash"
msgstr "Переместить в корзину"

#. Item count in the status bar
#: src/browser.c:118
#, c-format
msgid "%d file"
msgid_plural "%d files"
msgstr[0] "%d файл"
msgstr[1] "%d файла"
msgstr[2] "%d файлов"

#. Selection summary
#: src/browser.c:164
#, c-format
msgid "%d folder selected"
msgid_plural "%d folders selected"
msgstr[0] "Выбран %d каталог"
msgstr[1] "Выбрано %d каталога"
msgstr[2] "Выбрано %d каталогов"

#. Undo toast after a delete
#: src/trash.c:73
66 lines total — download for the full file.

Specifications

Locale
ru
Language
Russian
Nplurals
3
Plural Forms
nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);
Plural Entries
4
Singular Entries
2
Cldr Categories
one, few, many, other (4) — gettext folds the last two into form 2
Charset
UTF-8
Seed
20260807
Wave
p7
Line Endings
LF

Testing contract

Expected to pass
Scenario
Compile with msgfmt (or parse directly) and call ngettext for a value from each of the 3 plural forms.
Expected result
The Plural-Forms expression selects form 0 through 2 for the counts documented in the matching CLDR fixture, and the compiled output is byte-identical to the .mo twin shipped beside it.

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 with Plural-Forms — Russian (nplurals=3)” is a deterministic Novus Examples fixture for Internationalization, Localization catalogs. Parallel text and accented, multi-script content — for testing translation pipelines, Unicode handling, and localization tooling.

Documented properties for this file: seed 20260807 · Russian · 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("app-ru.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.