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
Prev Previous commit
Next Next commit
Update repo_user.liquid
implemented the requested change
jiaye-wu authored Feb 14, 2025
commit d9cd3b9c8ccce96eac70c27a777cc7148e146118
12 changes: 6 additions & 6 deletions _includes/repository/repo_user.liquid
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{% assign lang = site.active_lang | split: '-' | first %}
{% assign lang = site.lang | split: '-' | first %}

{% case lang %}
{% when 'pt' %}
{% assign lang = site.active_lang %}
{% assign lang = site.lang %}

{% when 'zh' %}
{% assign lang_last = site.active_lang | split: '-' | last %}
{% assign lang_last = site.lang | split: '-' | last %}
{% case lang_last %}
{% when 'cn', 'sg', 'my', 'hans' %}
{% assign lang = 'cn' %}
{% when 'tw', 'hk', 'mo', 'hant' %}
{% assign lang = 'zh-tw' %}

{% comment %} when... add a new language here if needed {% endcomment %}
{% endcase %}
{% endcase %}

{% comment %} Add a new language using when... if needed {% endcomment %}
{% comment %} If you still encounter language-display issues, check the available locale codes in github-readme-stats (different from ISO-639 standard used in your website): https://github.com/anuraghazra/github-readme-stats?tab=readme-ov-file#available-locales {% endcomment %}

<div class="repo p-2 text-center">
<a href="https://github.com/{{ include.username }}">
<img
class="only-light w-100"
alt="{{ include.username }}"
src="https://github-readme-stats.vercel.app/api/?username={{ include.username }}&theme={{ site.repo_theme_light }}&show_icons=true"
src="https://github-readme-stats.vercel.app/api/?username={{ include.username }}&theme={{ site.repo_theme_light }}&locale={{ lang }}&show_icons=true"
>
<img
class="only-dark w-100"
alt="{{ include.username }}"
src="https://github-readme-stats.vercel.app/api/?username={{ include.username }}&theme={{ site.repo_theme_dark }}&show_icons=true"
src="https://github-readme-stats.vercel.app/api/?username={{ include.username }}&theme={{ site.repo_theme_dark }}&locale={{ lang }}&show_icons=true"
>
</a>
</div>