Commit graph

10 commits

Author SHA1 Message Date
Virgil
e28a86d705 feat(time): use locale word fallback for relative time
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 08:41:07 +00:00
Virgil
ff42b06ae4 fix(time): normalise relative-time unit input
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:14:13 +00:00
Virgil
9f76b3ee3d fix(time): pluralize nil-service relative time fallback
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 1m58s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 05:14:43 +00:00
Virgil
bfada30290 fix(time): fallback just-now time strings
All checks were successful
Security Scan / security (push) Successful in 12s
Test / test (push) Successful in 1m47s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 02:38:45 +00:00
Virgil
91a1b2ece2 feat(i18n): localise French relative time
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m16s
Add month and year forms to the French relative-time table and cover them with a regression test.\n\nCo-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 23:01:10 +00:00
Virgil
5b32ed3e33 feat(time): add month and year relative formatting
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 1m12s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 22:57:55 +00:00
Virgil
891953d445 feat(time): accept month and year ago units
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m12s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 22:55:49 +00:00
Virgil
691663bca4 feat(i18n): accept plural ago units
All checks were successful
Security Scan / security (push) Successful in 12s
Test / test (push) Successful in 1m13s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 22:45:32 +00:00
Virgil
18cc20ff7b feat(i18n): add seconds granularity to TimeAgo
All checks were successful
Security Scan / security (push) Successful in 11s
Test / test (push) Successful in 1m4s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 09:28:23 +00:00
Claude
32a55f5d35
test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6%
Add dedicated test files for compose.go, context.go, debug.go, hooks.go,
i18n.go, localise.go, time.go, and transform.go. Uses testify
assert/require with table-driven tests and Good/Bad/Ugly naming.

Key coverage improvements:
- transform.go: toInt/toInt64/toFloat64 18.8% -> 100%
- time.go: TimeAgo/FormatAgo 0% -> 100%/87.5%
- compose.go: newTemplateData/SetFormality/IsInformal 0% -> 100%
- context.go: all functions now 100%
- debug.go: package-level SetDebug 0% -> 100%
- hooks.go: RegisterLocales 0% -> 100%
- i18n.go: T/Raw/N/SetMode/AddHandler/PrependHandler all covered

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 02:09:08 +00:00