fix: localize dates for all shipped languages (import moment locales) - #147
Open
everysingletear wants to merge 1 commit into
Open
fix: localize dates for all shipped languages (import moment locales)#147everysingletear wants to merge 1 commit into
everysingletear wants to merge 1 commit into
Conversation
Fixes donetick#142. `LocalizationContext` calls `moment.locale(language)` for the active language, but only `he` and `ja` are imported — so moment silently falls back to English date formatting for the other seven shipped languages: ar, de, es, fr, nl, pt and zh-CN. Each locale is imported statically, matching the existing `he`/`ja` lines. Static rather than dynamic because it matches the current pattern, is trivially reviewable, and a moment locale bundle is a few KB. Happy to switch to a dynamic import of just the active language if you'd rather keep the main bundle leaner. Rebased on current `develop`: this PR predates your `he` import, and the list now matches AVAILABLE_LANGUAGES exactly — every non-English entry there has its moment locale loaded. `ru` is deliberately absent; it belongs with the Russian locale work.
everysingletear
force-pushed
the
fix/moment-locales
branch
from
August 15, 2026 01:17
f4ccdab to
dab0443
Compare
This was referenced Aug 15, 2026
meauxt
pushed a commit
that referenced
this pull request
Aug 27, 2026
Adds `public/locales/ru/*` for all eleven namespaces — auth, chores, common, filters, history, labels, points, projects, settings, things, timer — covering every key currently in `public/locales/en` on develop. Two one-line source changes are needed for it to work: - `LocalizationContext.jsx` — registers `ru` in AVAILABLE_LANGUAGES, so the language shows up in the picker. - `i18n/config.js` — `import 'moment/locale/ru'`. Without it the UI translates but every date stays English, which reads worse than no translation at all. This is the same one-line-per-language change as #147; only the `ru` line is here so this PR stands alone. Notes for review: - Plural forms use the full Russian set (`_one/_few/_many/_other`). Russian has four plural categories, not two — with only `_one/_other` a count of 5 falls through to `_other` and renders ungrammatically. - Terminology is held consistent across all namespaces. Donetick uses "chore" and "task" for the same object; Russian picks one word and keeps it everywhere. - No English strings were changed, and no keys were added or removed. - `eslint`, `prettier -c`, `npm run lint:i18n` and `npm run build` are all green on this branch. Supersedes #143, which I closed in August because it covered three namespaces when there were already eleven. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #142.
LocalizationContextcallsmoment.locale(language)for the active language, but onlymoment/locale/jawas imported — so moment silently fell back to English date formatting for de, es, fr, nl, pt, zh-CN, ar (onlyenandjawere localized).Change
Import each shipped locale statically in
src/i18n/config.js, matching the existingmoment/locale/jaline.Why static (not dynamic)
The issue raised static vs dynamic import. I went static because it matches the existing pattern, is trivially reviewable, and moment locale bundles are tiny (a few KB each). If you'd rather keep the main bundle leaner, I'm happy to switch to a dynamic
import()of just the active language's locale — just say the word.Testing
npm run buildpasses; all imported locale files resolve.Note:
ruis intentionally not included here — it comes with the Russian locale PR (#143).