Internationalization

Hello!

I follow the development of Redwood and Blitz.js very closely. Next.js (and therefore Blitz.js) in v10 introduced Internationalized Routing. Is there something similar in the RedwoodJS land or some plan to introduce something like it (I found no open issue on that)? IMHO there is also some page missing in the docs regarding internationalization at all. The only hint I could find is some i18n generator that is not documented anywhere.

1 Like

Hi @medihack !
Welcome to the Redwood community :grinning_face_with_smiling_eyes:

Yes, we have some plan to introduce sub-path Routing for i18n.

You can look at this issue than will make possible optional path parameters :

For now, you can add path parameter for language in your routing and make it work with something like this :

const HomePage = ({language}) => {
  const { t, i18n } = useTranslation()

  useEffect(() => {
    i18n.changeLanguage(language)
  }, [i18n, language])

If you need some help with i18n + RedwoodJS, I will be more than happy to help you.

3 Likes