diff --git a/_includes/repository/repo.liquid b/_includes/repository/repo.liquid index 0f1afd42a46f..c99b76b0117d 100644 --- a/_includes/repository/repo.liquid +++ b/_includes/repository/repo.liquid @@ -5,6 +5,26 @@ {% assign show_owner = true %} {% endif %} +{% assign lang = site.lang | split: '-' | first %} + +{% case lang %} + {% when 'pt' %} + {% assign lang = site.lang %} + + {% when 'zh' %} + {% 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' %} + {% endcase %} + + {% comment %} Add a new language using when... if needed {% endcomment %} +{% endcase %} + +{% 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 %} + {% if site.data.repositories.repo_description_lines_max %} {% assign max_lines = site.data.repositories.repo_description_lines_max %} {% else %} @@ -16,12 +36,12 @@ {{ include.repository }} {{ include.repository }} diff --git a/_includes/repository/repo_user.liquid b/_includes/repository/repo_user.liquid index 7dc959f929ad..294d58a116e4 100644 --- a/_includes/repository/repo_user.liquid +++ b/_includes/repository/repo_user.liquid @@ -1,14 +1,34 @@ +{% assign lang = site.lang | split: '-' | first %} + +{% case lang %} + {% when 'pt' %} + {% assign lang = site.lang %} + + {% when 'zh' %} + {% 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' %} + {% endcase %} + + {% comment %} Add a new language using when... if needed {% endcomment %} +{% endcase %} + +{% 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 %} +
{{ include.username }} {{ include.username }}