Skip to content

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented Dec 30, 2021

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 30, 2021
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Dec 31, 2021

Could we refactor the function TrN and make them share the same code?

func TrN(lang string, cnt interface{}, key1, keyN string) string {

IMO we should have a unified behavior in both template and backend code.

ps: the old TrN need to be refactored, too. The templates call it by {{.i18n.Tr (TrN .i18n.Lang ... ) }}, it is complex and might be simplified to {{.i18n.TrN ....}} directly.

@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 Dec 31, 2021
@lunny lunny added modifies/translation and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Dec 31, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #18135 (3bd0e29) into main (ffaebb1) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18135      +/-   ##
==========================================
- Coverage   44.95%   44.94%   -0.01%     
==========================================
  Files         825      825              
  Lines       91559    91575      +16     
==========================================
- Hits        41159    41158       -1     
- Misses      43818    43837      +19     
+ Partials     6582     6580       -2     
Impacted Files Coverage Δ
routers/web/repo/migrate.go 35.42% <0.00%> (-1.26%) ⬇️
routers/web/repo/repo.go 31.28% <0.00%> (-0.59%) ⬇️
routers/web/repo/setting.go 16.12% <0.00%> (-0.09%) ⬇️
models/unit/unit.go 41.09% <0.00%> (-2.74%) ⬇️
modules/queue/workerpool.go 50.00% <0.00%> (-2.30%) ⬇️
modules/log/file.go 73.60% <0.00%> (-1.61%) ⬇️
models/repo_list.go 76.62% <0.00%> (-0.60%) ⬇️
modules/process/manager.go 82.94% <0.00%> (+1.55%) ⬆️
modules/queue/queue_channel.go 96.66% <0.00%> (+1.66%) ⬆️
modules/charset/charset.go 75.75% <0.00%> (+4.04%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3d6850...3bd0e29. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Dec 31, 2021
@lunny
Copy link
Member

lunny commented Dec 31, 2021

Could we refactor the function TrN and make them share the same code?

func TrN(lang string, cnt interface{}, key1, keyN string) string {

IMO we should have a unified behavior in both template and backend code.

ps: the old TrN need to be refactored, too. The templates call it by {{.i18n.Tr (TrN .i18n.Lang ... ) }}, it is complex and might be simplified to {{.i18n.TrN ....}} directly.

That could be another PR.

@lunny lunny merged commit 7eb380b into go-gitea:main Dec 31, 2021
@lunny
Copy link
Member

lunny commented Dec 31, 2021

Please send backport.

@wxiaoguang
Copy link
Contributor

I proposed a refactoring for TrN:

zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 1, 2022
* giteaoffical/main:
  tests: s/GITEA_UNIT_TESTS_VERBOSE/GITEA_UNIT_TESTS_LOG_SQL/ (go-gitea#18142)
  services/repository: fix ListUnadoptedRepositories incorrect total count (go-gitea#17865)
  Improve document for developers: Windows CGO, unit test option (go-gitea#18140)
  Reset the conflicted files list in testpatch (go-gitea#18139)
  Use correct translation key (go-gitea#18135)
@Gusted Gusted deleted the correct-tr branch January 1, 2022 22:50
Gusted pushed a commit to Gusted/gitea that referenced this pull request Jan 1, 2022
@zeripath zeripath added the backport/done All backports for this PR have been created label Jan 2, 2022
@zeripath zeripath changed the title Use correct translation key Use correct translation key for max repo limit error messages Jan 2, 2022
6543 pushed a commit that referenced this pull request Jan 2, 2022
Refer: #18135 (comment)

Now we have a unique and simple `TrN`, and make the fix of PR #18135 also use the better `TrN` logic.
@richmahn richmahn mentioned this pull request Jan 14, 2022
zeripath pushed a commit that referenced this pull request Jan 14, 2022
[1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14

* BUGFIXES
  * Fix inconsistent PR comment counts (#18260) (#18261)
  * Fix release link broken (#18252) (#18253)
  * Fix update user from site administration page bug (#18250) (#18251)
  * Set HeadCommit when creating tags (#18116) (#18173)
  * Use correct translation key for error messages due to max repo limits (#18135 & #18153) (#18152)
  * Fix purple color in suggested label colors (#18241) (#18242)
* SECURITY
  * Bump mermaid from 8.10.1 to 8.13.8 (#18198) (#18206)
zeripath pushed a commit to zeripath/gitea that referenced this pull request Jan 14, 2022
[1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14

* BUGFIXES
  * Fix inconsistent PR comment counts (go-gitea#18260) (go-gitea#18261)
  * Fix release link broken (go-gitea#18252) (go-gitea#18253)
  * Fix update user from site administration page bug (go-gitea#18250) (go-gitea#18251)
  * Set HeadCommit when creating tags (go-gitea#18116) (go-gitea#18173)
  * Use correct translation key for error messages due to max repo limits (go-gitea#18135 & go-gitea#18153) (go-gitea#18152)
  * Fix purple color in suggested label colors (go-gitea#18241) (go-gitea#18242)
* SECURITY
  * Bump mermaid from 8.10.1 to 8.13.8 (go-gitea#18198) (go-gitea#18206)
techknowlogick pushed a commit that referenced this pull request Jan 14, 2022
* Changelog for 1.15.10 (#18274)

[1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14

* BUGFIXES
  * Fix inconsistent PR comment counts (#18260) (#18261)
  * Fix release link broken (#18252) (#18253)
  * Fix update user from site administration page bug (#18250) (#18251)
  * Set HeadCommit when creating tags (#18116) (#18173)
  * Use correct translation key for error messages due to max repo limits (#18135 & #18153) (#18152)
  * Fix purple color in suggested label colors (#18241) (#18242)
* SECURITY
  * Bump mermaid from 8.10.1 to 8.13.8 (#18198) (#18206)

* update docs/config.yaml

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Richard Mahn <richmahn@users.noreply.github.com>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
- Resolves go-gitea#18122

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
Refer: go-gitea#18135 (comment)

Now we have a unique and simple `TrN`, and make the fix of PR go-gitea#18135 also use the better `TrN` logic.
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
* Changelog for 1.15.10 (go-gitea#18274)

[1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14

* BUGFIXES
  * Fix inconsistent PR comment counts (go-gitea#18260) (go-gitea#18261)
  * Fix release link broken (go-gitea#18252) (go-gitea#18253)
  * Fix update user from site administration page bug (go-gitea#18250) (go-gitea#18251)
  * Set HeadCommit when creating tags (go-gitea#18116) (go-gitea#18173)
  * Use correct translation key for error messages due to max repo limits (go-gitea#18135 & go-gitea#18153) (go-gitea#18152)
  * Fix purple color in suggested label colors (go-gitea#18241) (go-gitea#18242)
* SECURITY
  * Bump mermaid from 8.10.1 to 8.13.8 (go-gitea#18198) (go-gitea#18206)

* update docs/config.yaml

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Richard Mahn <richmahn@users.noreply.github.com>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message broken when migrating repo at max repo limit
7 participants