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

adapt README_{Country}.md stype name in localizedExtensions #21486

Merged
merged 30 commits into from
Oct 24, 2022

Conversation

a1012112796
Copy link
Member

This stype name is also used in many repos, example: README_ZH.md

Signed-off-by: a1012112796 <1012112796@qq.com>
@a1012112796 a1012112796 added topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality and removed topic/ui Change the appearance of the Gitea UI labels Oct 17, 2022
Signed-off-by: a1012112796 <1012112796@qq.com>
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Oct 17, 2022
@lunny lunny added this to the 1.18.0 milestone Oct 17, 2022
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@6af1a0c). Click here to learn what that means.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main   #21486   +/-   ##
=======================================
  Coverage        ?   47.85%           
=======================================
  Files           ?     1027           
  Lines           ?   139605           
  Branches        ?        0           
=======================================
  Hits            ?    66801           
  Misses          ?    64795           
  Partials        ?     8009           
Impacted Files Coverage Δ
routers/web/repo/view.go 44.19% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 18, 2022
@ghost

This comment was marked as outdated.

@a1012112796 a1012112796 added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Oct 18, 2022
@zeripath zeripath changed the title adapt README_{Contry}.md stype name in localizedExtensions adapt README_{Country}.md stype name in localizedExtensions Oct 18, 2022
routers/web/repo/view.go Outdated Show resolved Hide resolved
@lunny
Copy link
Member

lunny commented Oct 19, 2022

format error

// e.g. [.zh-cn.md, .zh_cn.md, .zh.md, .md]
return []string{lowerLangCode + ext, underscoreLangCode + ext, lowerLangCode[:indexOfDash] + ext, ext}
// e.g. [.zh-cn.md, .zh_cn.md, .zh.md, _zh.md, .md]
return []string{lowerLangCode + ext, underscoreLangCode + ext, lowerLangCode[:indexOfDash] + ext, "_" + lowerLangCode[1:indexOfDash] + ext, ext}
Copy link
Contributor

@wxiaoguang wxiaoguang Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function was designed for work for both languageCode=en-US and languageCode=en.

This change only supports languageCode=en-US, while line 158-159 are for languageCode=en, the behaviors are inconsistent now.

However, I have no objection to merge this PR since there is no languageCode=en in Gitea code, while it's better to document the behavior.

Copy link
Member Author

@a1012112796 a1012112796 Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, In my view, the en is same with en-US (or other). in other words, it's not a good idea to add a new file named as locale_en.ini in i18n folder. and the link 'https://gitea.com/?lang=en' should have same behave with 'https://gitea.com/?lang=en-US'

and if just choose language while ui, languageCode=en willn't occure.

Copy link
Contributor

@wxiaoguang wxiaoguang Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, Gitea doesn't use the en or zh at the the moment, the code is just there. Line 158-159 won't run in current Gitea, it's just inconsistent dead code. (just a hint)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, In my view, the en is same with en-US (or other).

There is a complex and special relationship between en, en-US, en_001 and other en subvariants e.g. en_GB

Whilst en-US is the default locale for en, it is not en. For example the rules for dates in en-US are extremely different from those for almost every other en variant. CLDR has en_001 which almost completely overrides most US weirdness and means that most English regional locales inherit from en_001 rather than en directly.

https://cldr.unicode.org/development/development-process/design-proposals/english-inheritance

Our translation scheme isn't really designed at present to properly consider regional localisation but we're probably going to have to consider it at some point soon.

@lunny
Copy link
Member

lunny commented Oct 24, 2022

make L-G-T-M work

@lunny lunny merged commit e1ce45e into go-gitea:main Oct 24, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 24, 2022
* upstream/main:
  adapt README_{Country}.md stype name in localizedExtensions (go-gitea#21486)
  dump: Add option to skip index dirs (go-gitea#21501)
  Use recommended vscode configuration in gitpod environments (go-gitea#21537)
  Expand "Go to File" button again, fix 'Add File' margin (go-gitea#21543)
  Add yardenshoham to maintainers (go-gitea#21566)
  Refactor git command arguments and make all arguments to be safe to be used (go-gitea#21535)
  Update binding to fix bugs (go-gitea#21556)
  Link mentioned user in markdown only if they are visible to viewer (go-gitea#21554)
  Require authentication for OAuth token refresh (go-gitea#21421)
  CSS color enhancements (go-gitea#21534)
  Allow package version sorting (go-gitea#21453)
  Add link to user profile in markdown mention only if user exists (go-gitea#21533)
  Update milestone counters when issue is deleted (go-gitea#21459)
  Prevent Authorization header for presigned LFS urls (go-gitea#21531)
  Remove deleted repos from searchresult (go-gitea#21512)
  Remove unnecessary debug log (go-gitea#21536)
  Added check for disabled Packages (go-gitea#21540)
  Decouple HookTask from Repository (go-gitea#17940)
  Add color previews in markdown (go-gitea#21474)
  Fix generating compare link (go-gitea#21519)
@a1012112796 a1012112796 deleted the zzc/dev/readme_link branch October 24, 2022 07:07
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants