Skip to content

Add missing zh(Hans) translation pages #783

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

Closed
lirenjie95 opened this issue Apr 10, 2025 · 3 comments · Fixed by #785
Closed

Add missing zh(Hans) translation pages #783

lirenjie95 opened this issue Apr 10, 2025 · 3 comments · Fixed by #785
Assignees

Comments

@lirenjie95
Copy link
Contributor

lirenjie95 commented Apr 10, 2025

As mentioned in #708 (comment), I have compiled a list of pages that are untranslated into Chinese.

@ksen0, can you please assign this issue to me?

I still have other questions:

  1. Can I use this issue to also track a PR in the p5.js repo?
  2. For privacy-policy.mdx and terms-of-use.mdx, these two documents contain a lot of legal terms. Should they be excluded from the translation and only the English version be retained to ensure accurate expression?
@ksen0
Copy link
Member

ksen0 commented Apr 10, 2025

Hi @lirenjie95 , thank you so much for your attention to this.

Yes, please feel free to use this issue to track all PRs across both repos and go ahead to work on the points you made. Feel free to split them up in multiple PRs if and where it's helpful for you.

about.mdx is translated into Chinese, but it has some display issues as shown in https://p5js.org/zh-Hans/about/

Any ideas why that's happening / if it is affecting other pages or languages? All the other tasks seem like translation tasks, but if this is a bug maybe it is better to make a separate issue for it - unless you already have a fix.

@lirenjie95
Copy link
Contributor Author

Hi @ksen0, I added some logs in the code file src/pages/[locale]/about.astro and found that the getEntry function can't find the zh-Hans/about.mdx file even though it is there. I checked for any issues with UTF-8 encoding, but it seems fine. I suspect the issue might be with the getEntry function, as it uses the startsWith function call, and the zh-Hans string contains a -, which might cause the parser to fail. (@davepagurek @limzykenneth, please correct me if I'm wrong.)

I checked other files dealing with multiple languages and found they use the getCollectionInLocaleWithFallbacks function. So, I rewrote the code file using it, which has three advantages:

  1. automatically handles multilingual content;
  2. automatically handles fallback to the default language;
  3. provides better error handling.

Related commit: 4678492

@ksen0 ksen0 reopened this Apr 11, 2025
@lirenjie95
Copy link
Contributor Author

Closed as all related PRs got merged.

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

Successfully merging a pull request may close this issue.

2 participants