Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement i18n #2

Open
peduarte opened this issue Feb 8, 2019 · 2 comments
Open

Implement i18n #2

peduarte opened this issue Feb 8, 2019 · 2 comments

Comments

@peduarte
Copy link

peduarte commented Feb 8, 2019

We could use gatsby-plugin-i18n

@DirtyF
Copy link
Contributor

DirtyF commented Feb 8, 2019

Correct me if I'm wrong; based on the starter source translations go into local/messages. Within this folder we have one file per language, for instance:

en.json:

{
  "JAMstack is revolutionising the way we think about workflow by providing a simpler developer experience, better performance, lower cost and greater scalability.": "JAMstack is revolutionising the way we think about workflow by providing a simpler developer experience, better performance, lower cost and greater scalability.",
  "This simple guide will help you understand why it exists and how to get started.": "This simple guide will help you understand why it exists and how to get started",
  "Table of contents": "Table of contents",
  "What is JAMstack?": "What is JAMstack?",
  "Meaning": "Meaning",
  "Benefits": "Benefits",
  "Best practices": "Best practices",
  "Getting started": "Getting started",
  "Development": "Development",
  "Deployment": "Deployment",
  "Dynamic parts": "Dynamic parts",
  "Resources": "Resources",
  "About": "About"
}

fr.json

{
  "JAMstack is revolutionising the way we think about workflow by providing a simpler developer experience, better performance, lower cost and greater scalability.": "La JAMstack révolutionne notre façon de penser la chaîne de publication en proposant, une expérience de développement plus simple, une meilleure performance, et une plus grande scalabilité.",
  "This simple guide will help you understand why it exists and how to get started.": "Ce petit guide vous aide à comprendre pourquoi elle existe et comment bien démarrer.",
  "Table of contents": "Sommaire",
  "What is JAMstack?": "C'est quoi la JAMstack ?",
  "Meaning": "Signification",
  "Benefits": "Bénéfices",
  "Best practices": "Bonnes pratiques",
  "Getting started": "Bien démarrer",
  "Development": "Développement",
  "Deployment": "Déploiement",
  "Dynamic parts": "Parties dynamiques",
  "Resources": "Ressources",
  "About": "À propos"
}

@peduarte
Copy link
Author

peduarte commented Feb 8, 2019

Yeah, but I'd like to explore using translations with MDX.

I think there may be a way to have each content in a Markdown file.

So For example:

what-is-jamstack.en.md
what-is-jamstack.fr.md
getting-started.en.md
getting-started.fr.md
...

then with mdx render that within React, and map the html elements to React Components so I can add the extra components, such as the diagrams etc...

Not sure if it'll work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants