Skip to content

Add more translations - #101

Open
alexxiy wants to merge 3 commits into
jimmiw:masterfrom
alexxiy:master
Open

Add more translations#101
alexxiy wants to merge 3 commits into
jimmiw:masterfrom
alexxiy:master

Conversation

@alexxiy

@alexxiy alexxiy commented Mar 11, 2026

Copy link
Copy Markdown

Add translations:

  • Azerbaijani
  • Belarusian
  • Portuguese

alexxiy and others added 3 commits March 11, 2026 12:08
Add translations:
- Azerbaijani
- Belarusian
- Portuguese
Fork of jimmiw/php-time-ago, rewritten for PHP 8.5.

- Namespace Alexxiy\TimeIntervals mapped to src/; entry class is now
  IntervalFormatter, since TimeAgo described only one of three tenses.
- Tense (past/future/plain) and Style (full/short) as orthogonal axes.
- CLDR plural rules; Russian says 2 дня / 5 дней / 21 день.
- Fixes: counted buckets rendered "1 days ago", Arabic dropped its counts,
  never was missing from 17 languages, "about one day" was the word for
  yesterday in seven, and ten further defects found in review.
- strict_types everywhere, PHPStan level max, 7478 tests at 100% coverage.

See CHANGELOG.md and TRANSLATIONS.md.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Every threshold is now the point at which the rounded count changes,
replacing a mix of rounded and floored rules inherited from Rails.

- "about one X" covered [1X, 2X): 59 days read "about 1 month", 47 hours
  read "1 day", 23 months read "about 1 year". Each is now centred.
- Counts floored, so values read up to a whole unit low: 2m40s was
  "2 minutes", 91 days was "2 months".
- The month handover was a fixed day count while months are calendar
  units, so 1 Feb - 1 Apr read "about 1 month" in 2021 but "2 months"
  in 2024. It now reads "2 months" in both.

"over N years" counts whole years elapsed, never rounded months, so it
cannot overstate: 1 year 11 months reads "over 1 year".

No API and no translation string changed; what changed is which phrase
an interval selects. Adds monotonicity and no-overstatement property
tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant