-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
Signed-off-by: a1012112796 <1012112796@qq.com>
Codecov Report
@@ Coverage Diff @@
## main #21486 +/- ##
=======================================
Coverage ? 47.85%
=======================================
Files ? 1027
Lines ? 139605
Branches ? 0
=======================================
Hits ? 66801
Misses ? 64795
Partials ? 8009
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: zeripath <art27@cantab.net>
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} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
make L-G-T-M work |
* 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)
This stype name is also used in many repos, example:
README_ZH.md