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

i18n out of the box #17

Open
saurabhdaware opened this issue May 24, 2020 · 7 comments
Open

i18n out of the box #17

saurabhdaware opened this issue May 24, 2020 · 7 comments
Labels
enhancement New feature or request future plan We will explore this in future Idea A random idea before actually putting it out in code Need Feedback Need feedback on this issue
Milestone

Comments

@saurabhdaware
Copy link
Member

If we could have content like this,

content/
    |- my-cool-blog/
        |- index.md
        |- index_zh-Hans.md
        |- index_hi.md

so if a user prefers Mandarin, he will get content from index_zh-Hans.md (zh-CN is the code of Chinese Simplified)

@saurabhdaware saurabhdaware added enhancement New feature or request help wanted Extra attention is needed Idea A random idea before actually putting it out in code Need Feedback Need feedback on this issue labels May 24, 2020
@saurabhdaware saurabhdaware added this to the v1.0.0 milestone May 29, 2020
@saurabhdaware saurabhdaware added the Major Update Issue/PR related to major update that needs lots of changes in code label Jun 19, 2020
@judicaelandria
Copy link
Contributor

Guess this is a great solution, but we will many files with that

@saurabhdaware
Copy link
Member Author

yeah fair point, Have you seen any project handling i18n? I am a little clueless about this right now. Are there suppose to be two different websites for two different languages? or just the same website where you switch content with JavaScript?

@judicaelandria
Copy link
Contributor

No, no, same website but separating translations into multiple files and load them on demand

@saurabhdaware
Copy link
Member Author

oh yes makes sense

@judicaelandria
Copy link
Contributor

oh yeah! like what you show on the top,
but need to add the code for each language in the documentation

@kasipavankumar
Copy link

kasipavankumar commented Sep 7, 2020

There are two possibilities we can think of.

  1. The site can have subdomains based on the language. For instance, the React Documentation's Hindi variant has hi.reactjs.org or Spanish variant has es.reactjs.org.
  2. When user requests for a translated page, it can be routed to respective language sub pages as can be seen at overreacted.io. For example, a post has URL of https://overreacted.io/goodbye-clean-code & Spanish version of the post has URL of https://overreacted.io/es/goodbye-clean-code. This logic is probably handled by a Gatsby plugin named gatsby-plugin-i18n.

References

@saurabhdaware
Copy link
Member Author

Yes 2nd method seems like a better option. Thank you for the help @kasipavankumar :D

@saurabhdaware saurabhdaware added future plan We will explore this in future and removed Major Update Issue/PR related to major update that needs lots of changes in code help wanted Extra attention is needed labels Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request future plan We will explore this in future Idea A random idea before actually putting it out in code Need Feedback Need feedback on this issue
Projects
None yet
Development

No branches or pull requests

3 participants