Skip to content

Add Czech (cs_CZ) locale#330

Open
r1cksync wants to merge 1 commit into
python-humanize:mainfrom
r1cksync:add-czech-locale
Open

Add Czech (cs_CZ) locale#330
r1cksync wants to merge 1 commit into
python-humanize:mainfrom
r1cksync:add-czech-locale

Conversation

@r1cksync

Copy link
Copy Markdown

Add Czech (cs_CZ) locale

This adds a complete Czech translation catalog for humanize.

What's translated

  • Filesize strings (%d Byte / %d Bytesbajt / bajtů)
  • Large-number scale words for intword using long-scale Czech naming: milion, miliarda, bilion, biliarda, trilion, triliarda, kvadrilion, ... down to googol
  • Relative time phrases for naturaltime / naturaldelta (před %s / za %s, nyní, dnes, zítra, včera, plus all second/minute/hour/day/month/year units)
  • Ordinals (ordinal) — Czech ordinals are written with a trailing period (e.g. 5.)

Plural forms

Czech has three plural categories (one / few / many). The catalog declares the standard rule:

Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;

and provides msgstr[0..2] for every plural message (matching the existing Slovak sk_SK catalog, a closely related language).

How it was produced

The template was regenerated from the current sources with the documented workflow (xgettext with the project's keyword set), the catalog initialised with msginit --locale cs_CZ, then every msgstr translated by hand. msgfmt --check reports 59 translated, 0 fuzzy, 0 untranslated and validates all format strings and plural counts.

Tests

  • Added cs_CZ cases to the parametrized test_intword_i18n and test_naturalsize_i18n tests in tests/test_i18n.py.
  • Listed Czech in the README locale list, as the contributing docs request.
  • Full suite passes locally: 777 passed. ruff check clean.

Only the .po source is committed; .mo binaries remain gitignored and are produced by scripts/generate-translation-binaries.sh, matching every other locale.

Add a complete Czech translation catalog for humanize, covering
filesize, large-number scale words (intword), relative time phrases
(naturaltime/naturaldelta) and ordinals.

Czech uses three plural forms (one / few / many), declared via the
standard Plural-Forms header, with msgstr[0..2] provided for every
plural message. Number scale words follow the long-scale Czech naming
(milion, miliarda, bilion, biliarda, trilion, ...) and ordinals use the
trailing period that Czech ordinals require.

Also list Czech in the README locale list and add cs_CZ cases to the
parametrized intword and naturalsize i18n tests.
@hugovk

hugovk commented Jun 23, 2026

Copy link
Copy Markdown
Member

Do you speak Czech?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants