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

fix language-not-found issues on repo page with simplified and traditional Chinese #3015

Merged
merged 11 commits into from
Feb 14, 2025

Conversation

jiaye-wu
Copy link
Contributor

The author of github-readme-stats uses the non-standard code "cn" for simplified Chinese, see here. While for traditional Chinese the author only provides "zh-tw". The github-readme-stats functions on repo page will break if the user sets the site language to ALL variants of Chinese except for zh-tw. This hack is to make all sub-variants of simplified Chinese fall back to "cn" and all sub-variants of traditional Chinese fall back to "zh-tw".

This patch fixes the problem and has been tested locally & with GitHub pages.

…ional Chinese

The author of github-readme-stats uses the non-standard code "cn" for simplified Chinese, see [here](https://github.com/anuraghazra/github-readme-stats?tab=readme-ov-file#available-locales). While for traditional Chinese the author only provides "zh-tw". The github-readme-stats functions on repo page will break if the user sets the site language to ALL variants of Chinese except for zh-tw. This hack is to make all sub-variants of simplified Chinese fall back to "cn" and all sub-variants of traditional Chinese fall back to "zh-tw".
Copy link

netlify bot commented Feb 13, 2025

Deploy Preview for relaxed-lollipop-b6bc17 ready!

Name Link
🔨 Latest commit 78e707a
🔍 Latest deploy log https://app.netlify.com/sites/relaxed-lollipop-b6bc17/deploys/67af6101d059500008c4aafb
😎 Deploy Preview https://deploy-preview-3015--relaxed-lollipop-b6bc17.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jiaye-wu jiaye-wu requested a review from george-gca February 13, 2025 17:39
try to satisfy Prettier requirement
switch to the `case-when` structure to make code eaiser to maintain in the future.
switch to the `case-when` structure to make code eaiser to maintain in the future.
@george-gca
Copy link
Collaborator

george-gca commented Feb 14, 2025

You should use site.lang instead of site.active_lang here. site.active_lang is a polyglot feature. In the al-folio we use the lang defined in _config.yml.

lang: en # the language of your site (for example: en, fr, cn, ru, etc.)

Also, you are missing the use of the lang variable in both scripts, like &locale={{ lang }}.

@jiaye-wu
Copy link
Contributor Author

jiaye-wu commented Feb 14, 2025

Implemented the requested changes.

implemented the requested change
implemented the requested change
fixed a typo
@jiaye-wu jiaye-wu requested a review from george-gca February 14, 2025 14:19
impleted the requested change
implemented the requested change
@jiaye-wu jiaye-wu requested a review from george-gca February 14, 2025 14:46
tried my best to make prettier happy...
tried my best to make prettier happy...
@jiaye-wu jiaye-wu requested a review from george-gca February 14, 2025 15:28
@george-gca george-gca merged commit 7719863 into alshedivat:main Feb 14, 2025
10 checks passed
@george-gca
Copy link
Collaborator

Thanks for your contribution!

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.

2 participants