next-with-lingui
next-with-lingui copied to clipboard
Notes
Hey @disintegrator, this looks really awesome!
I tried to improve it, but LinguiJS is missing few features:
-
to support reloading of messages without page refresh
@lingui/loader
need to receive a parameter, because for initial render we needcompileNamespace=window.LINGUI_INIT
, but for dynamically loading catalogs we need regular cjs or es export. -
lingui extract --watch
(orlingui watch
) would be very useful to automatically extract messages. -
i18n
object could have methodonLocaleRequest
, where you could register callback (e.g. dynamic load of catalog) if locale is changed. Then we could usei18n.activate('en')
to change active locale
So, I think for now you did the best what you can. I'll take a look next week how we could improve LinguiJS API to provide smoother implementation in SSR apps.