diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-12 23:42:23 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-12 23:42:23 +0200 |
| commit | cf93acb8ad44ba9cd486e8f6457d9fd9fbc041cc (patch) | |
| tree | 71ebf9abed3fe2b96262443e33da767315a5f7d2 /lib/tasks | |
| parent | d320f8509751a886adb3ca723ebfafccaa8c191b (diff) | |
Add a locale-aware relative-time helper; drop stale locale overrides
Node.recently_changed and the new dashboard need "X ago" rendered
correctly in both locales. Rails' own distance_of_time_in_words/
time_ago_in_words can't do this on their own -- the scope option
changes which translation key is looked up, not the underlying
grammar, and German's "vor" requires dative case, which is a
different word form than the nominative plural Rails computes by
default. relative_time_phrase/relative_distance is a small, from-
scratch bucketing helper instead, with an explicit, hand-checked
translation table per unit per locale.
Also removes de.yml's datetime.distance_in_words and activerecord.
errors blocks. Both used the old {{count}}/{{model}} interpolation
syntax the current i18n gem no longer recognizes -- it silently
leaves the literal placeholder text in the rendered output rather
than erroring, which is why this went unnoticed until now. Both were
shadowing rails-i18n's own current, correct translations for exactly
these keys; deleting the local override lets the gem's version take
over instead of maintaining a second, broken copy.
Diffstat (limited to 'lib/tasks')
0 files changed, 0 insertions, 0 deletions
