Skip to content

Fix German grammatical cases in naturaltime - #434

Open
Boulea7 wants to merge 1 commit into
python-humanize:mainfrom
Boulea7:ln-cx/fix-german-naturaltime-263
Open

Boulea7 wants to merge 1 commit into
python-humanize:mainfrom
Boulea7:ln-cx/fix-german-naturaltime-263

Conversation

@Boulea7

@Boulea7 Boulea7 commented Oct 2, 2026

Copy link
Copy Markdown

Fixes #263

Changes proposed in this pull request:

  • Use German dative forms in naturaltime, such as vor einer Stunde and in 2 Tagen, with ordinary-translation fallback and unchanged public signatures.
  • Detect now from the duration rather than translated text, fixing Turkish one-second past and future output. Custom catalogs that relied on matching non-moment text to a moment will now produce relative time.
  • Add real-catalog regressions and verify extraction, merge, and compilation round trips.

Validation (Python 3.11, Linux): 986 tests passed; 22 prek hooks passed. Full prek was blocked installing yamlfmt by a proxy.golang.org timeout on both main and this branch.

Local measurements: French missing-context fallback adds about 0.45 µs per naturaltime call (+10.8%).

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.

German requires different cases for ‘%s ago’ and ‘%s from now’

1 participant