Skip to content

Non-English locales render dates in English (moment locale never imported) #142

Description

@everysingletear

LocalizationContext calls moment.locale(language) for whatever language is active (src/contexts/LocalizationContext.jsx), but the app only imports one moment locale:

// src/i18n/config.js
import 'moment/locale/ja'

moment silently falls back to the built-in en locale for any language whose locale bundle wasn't imported. So with the UI translated, dates still render in English for de, es, fr, nl, pt, zh-CN, ar — only en and ja get localized dates.

Steps to reproduce

  1. Switch the app language to German (or any language except en/ja).
  2. Open any view with a date (chore due date, activity feed).
  3. Month/weekday names and relative times ("2 hours ago") render in English.

Expected

Dates follow the selected language.

Possible fixes (would appreciate a maintainer's call before a PR)

  • Static: import every shipped moment/locale/<lng> in config.js. Simple, but pulls all locale data into the main bundle.
  • Dynamic: import only the active language's locale when it changes (await import(\moment/locale/${lng}`)`), keeping the bundle lean.

Happy to open a PR — which approach do you prefer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions