raae/pow-app

Use proper i18n solution

Opened this issue ยท 4 comments

raae commented

Not so much because I think we will translate the app at the moment, but to have one place to look for typos etc.

  • Select framework
  • Pull all text from code and into the framework

Here is some info on the Gatsby site: https://www.gatsbyjs.com/docs/localization-i18n/.

raae commented

I am wondering if we should just start with a dictionary of the texts, as these solutions are very advanced.

@raae
What do you mean by "a dictionary of the texts"

One file with all the text inside it?

Hi, I hope it's ok to barge in the conversation here. I want to share my experience with internationalization and just explain a bit how to work with react-i18n. It was easy to integrate it and I don't regret using it.

I have this template project where you can find it configured: https://tinyurl.com/yy2usy8a

Example Usage: in a component where you want to use translations:
export default withTranslation("translations")(ParticipantFromInvitation); - I used classes mostly so far
And where you want to have a string that is translatable:
import {Trans} from "react-i18next";
....
label=<Trans i18nKey="first_name"/>

Forgot to mention: the language code has to be appended in the URL.

I hope this helps.
Love the product!

raae commented

Thank you, this just made my day that you chime in like that @daisygabi :D