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

Juden main #30

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Juden main #30

wants to merge 4 commits into from

Conversation

judenung
Copy link

Translate some documents into Khmer language

@vercel
Copy link

vercel bot commented Jun 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
education-hub-articles ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2023 4:24pm

@matt-nervos
Copy link
Contributor

matt-nervos commented Jun 15, 2023

@judenung amazing, your contribution is greatly appreciated!

@Keith-CY does anything need to be changed somewhere else to support a new language?

@Keith-CY
Copy link
Collaborator

@judenung amazing, your contribution is greatly appreciated!

@Keith-CY does anything need to be changed somewhere else to support a new language?

There're 4 steps to support a new language:

  1. Add the locale in the locales list at https://github.com/Magickbase/nervos-official-website/blob/develop/next-i18next.config.js#L15 so URLs such as https://nervos.org/{locale}/ will be available for a specific language(fallback to en). This step is required;
  2. Add translation of the general copy at https://github.com/Magickbase/nervos-official-website/tree/develop/public/locales. This step is optional;
  3. Add translation of articles at https://github.com/NervosEducationHub/EducationHubArticles so https://nervos.org/{locale}/knowledge-base/{article} will be available(fallback to en if no translated article). This step is optional;
  4. Add a link to https://nervos.org/{locale} in the language list. This step is optional.
    image

@matt-nervos
Copy link
Contributor

thanks Keith, just want to confirm that 'kh' can be added to 1 without website translation.

Would it only show as an option on the knowledge base menu?

@Keith-CY
Copy link
Collaborator

thanks Keith, just want to confirm that 'kh' can be added to 1 without website translation.

If kh is added to step 1 without website translation(step 2), copies on the website https://nervos.org/kh/* fallback to English(set at https://github.com/Magickbase/nervos-official-website/blob/develop/next-i18next.config.js#L13)

And every article fallbacks to English unless it has a kh translation.

A similar example can be found here
Sidechains unlocking the potential only has the English one(https://github.com/NervosEducationHub/EducationHubArticles/tree/main/sidechains_unlocking_the_potential), it's still available on Chinese pages

https://www.nervos.org/zh/knowledge-base
image

https://www.nervos.org/zh/knowledge-base/sidechains_unlocking_the_potential
image

Would it only show as an option on the knowledge base menu?

The language menu is global, so step 4(add an option in the language menu) acts on every page. It's not recommended until step 2 is done.


Say we have done step 1 and step 3(this PR), https://nervos.org/kh/knowledger-base will be available with some kh articles and some en articles. It can be visited by URLs directly, but users won't see a link to https://nervos.org/kh on https://nervos.org.

Here's a preview of kh pages: https://nervos-official-website-git-enable-kh-locale-magickbase.vercel.app/kh

@matt-nervos
Copy link
Contributor

@judenung any interest in translating the website copy?

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

Successfully merging this pull request may close these issues.

4 participants