Skip to content

Fix localization for dependencies (fixes #1132)

Benjamin Bouvier requested to merge fix-dep-l10n into main

This fixes localization for dependencies by explicitly importing locale files in dependencies. I am not fond of the scattering it implies, but I haven't found any cleaner solution:

  • on the server, all the locales are imported. It seems fine to me, because we don't really care about the disk storage / memory impact on the server.
  • if we imported the moment locales in the shared helpers, we'd need to import moment/dist/locale/fr (e.g.) because vitejs requires that, but then this is not processed by ts on the server, so the latter will crash at startup.
  • instead, we have to put the moment locales in another file, that's only there in the client. Opted for client/helpers/index.
  • flatpickr locales also have to be explicitly imported; did that in a new client/components/ui/flatpickr file.
  • as a matter of fact, locale imports are now scattered in the client's code. Seems fine to me, as adding a new locale is not something we do that often.

Merge request reports