-
-
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
Improve update-locales script and fix locale processing bug #23240
Conversation
a6238d3
to
aaaf267
Compare
aaaf267
to
5a1e6de
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #23240 +/- ##
==========================================
+ Coverage 47.44% 47.56% +0.12%
==========================================
Files 1140 1143 +3
Lines 150804 151076 +272
==========================================
+ Hits 71549 71866 +317
+ Misses 70788 70705 -83
- Partials 8467 8505 +38
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
2508af5
to
c338fb9
Compare
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.
Thanks @wxiaoguang
I kept meaning to get round to looking at this as I suspected that something was going wrong to do with the ini output preparation.
This to me indicates again that we either need to get on with fixing go-ini or get off it.
I'd also say we might want to consider making this script some go code instead |
Agree, and I prefer to get rid of the I think this PR is the last fix by modifying the script. Next time we should decide whether use Go to rewrite or totally replace the |
replace #23239 |
🎺 🤖 |
if [[ $OSTYPE == 'darwin'* ]]; then | ||
# for macOS developers, use "brew install gnu-sed" | ||
SED=gsed | ||
fi |
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.
Could just do the same detection that Makefile
does and adapt sed
command syntax based on whether it is GNU or BSD sed. Better than to require the installation of additional software :)
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.
I'll check it out.
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.
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.
Thank you. Actually I have thought about this problem, but I didn't choose the sed -i''
for BSD sed, because the script has been here for long time, nobody really needs it, I just want to avoid any inconsistency. And I think this PR is the last fix by modifying the script 😂 in the future we should decide whether use Go to rewrite or totally replace the ini package.
The sed -i''
might also work, just like it in Makefile, but I haven't tested it.
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.
Some more explanations about my "worry about inconsistency": this script is hard to debug, and not covered by any test (unlike the sed in Makefile, any error can be found in the first time and gets fixed quickly). If there is any inconsistency between GNU sed and BSD sed, the problem can not be found until next crowdin sync runs, and it's difficult for macOS users to debug the inconsistency if they are using a different version.
If there is no inconsistency, then using sed -i''
is fine for BSD sed.
Just share some of my thoughts, for your information, no objection nor block. 😁
I didn't know where this script runs in. If it runs in the environment without bash (really? it's 2023 now ...), I think we should also revert the shebang line to #!/bin/sh and remove the bash related ps: I didn't see today's crowdin sync commit, does it mean that this script failed because I used bash in last PR? |
* giteaofficial/main: Use async await to fix empty quote reply at first time (go-gitea#23168) Fix switched citation format (go-gitea#23250) Improve update-locales script and fix locale processing bug (go-gitea#23240) Refactor `ctx` in templates (go-gitea#23105) Improve frontend guideline (go-gitea#23252) Close the temp file when dumping database to make the temp file can be deleted on Windows (go-gitea#23249) # Conflicts: # templates/repo/issue/view_content/context_menu.tmpl
Sorry, I think it's incorrect to use The last run fails: https://drone.gitea.io/go-gitea/gitea/68658/1/3
|
The locales of Gitea has been broken for long time, till now, it's still not fully fixed.
One of the root problems is that the
ini
library is quite quirky and theupdate-locales
script doesn't work well for all cases.This PR fixes the
update-locales
script to make it satisfyini
library and the crowdin.See the comments for more details.
The
locale_zh-CN.ini
is an example, it comes from crowdin and is processed by the newupdate-locales.sh
. Especially see thefeed_of
: https://github.com/go-gitea/gitea/pull/23240/files#diff-321f6ca4eae1096eba230e93c4740f9903708afe8d79cf2e57f4299786c4528bR268