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

Unify and simplify TrN for i18n #18141

Merged
merged 11 commits into from
Jan 2, 2022
Merged

Unify and simplify TrN for i18n #18141

merged 11 commits into from
Jan 2, 2022

Conversation

wxiaoguang
Copy link
Contributor

Refer: #18135 (comment)

Now we have a unique and simple TrN, and make the fix of PR #18135 also use the better TrN logic.

@wxiaoguang wxiaoguang added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 31, 2021
@wxiaoguang wxiaoguang force-pushed the refactor-trn branch 3 times, most recently from 5ccd327 to 9e485d8 Compare December 31, 2021 12:42
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 31, 2021
routers/web/repo/repo.go Outdated Show resolved Hide resolved
wxiaoguang and others added 3 commits January 1, 2022 00:18
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 31, 2021
@codecov-commenter

This comment has been minimized.

@@ -99,3 +100,66 @@ func (l *locale) Language() string {
func (l *locale) Tr(format string, args ...interface{}) string {
return i18n.Tr(l.Lang, format, args...)
}

// Language specific rules for translating plural texts
var trNLangRules = map[string]func(int64) int{
Copy link
Contributor

Choose a reason for hiding this comment

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

Off-Topic:

I didn't knew about this one, is this documented somewhere for translators?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea about is this documented somewhere for translators.

IMO it's mostly a knowledge for developers. If a developer write "text_1" and "text_n", the translators could just translate them without knowing TrN

routers/web/repo/repo.go Outdated Show resolved Hide resolved
modules/translation/translation.go Show resolved Hide resolved
modules/csv/csv_test.go Outdated Show resolved Hide resolved
# Conflicts:
#	routers/web/repo/migrate.go
#	routers/web/repo/repo.go
#	routers/web/repo/setting.go
@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 Jan 2, 2022
@6543 6543 merged commit e61b390 into go-gitea:main Jan 2, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 4, 2022
* giteaoffical/main: (22 commits)
  Add MP4 as default allowed attachment type (go-gitea#18170)
  [skip ci] Updated translations via Crowdin
  Include folders into size cost (go-gitea#18158)
  Don't delete branch if other PRs with this branch are open (go-gitea#18164)
  Remove unused route "/tasks/trigger" (go-gitea#18160)
  Fix EasyMDE validation (go-gitea#18161)
  Fix bug (go-gitea#18168)
  tests: add coverage for models migration helpers  (go-gitea#18162)
  [skip ci] Updated translations via Crowdin
  Require codereview to have content (go-gitea#18156)
  chore(lint): use golangci-lint to call revive and misspell checker. (go-gitea#18145)
  Update owners for 2022 (go-gitea#18155)
  Refactor auth package (go-gitea#17962)
  Unify and simplify TrN for i18n (go-gitea#18141)
  Use correct user when determining max repo limits for error messages (go-gitea#18153)
  Add singuliere to MAINTAINERS (go-gitea#18148)
  [skip ci] Updated licenses and gitignores
  Add API to get issue/pull comments and events (timeline) (go-gitea#17403)
  Upgrade certmagic from v0.14.1 to v0.15.2 (go-gitea#18138)
  Upgrade certmagic from v0.14.1 to v0.15.2 (go-gitea#18138)
  ...
@wxiaoguang wxiaoguang deleted the refactor-trn branch January 4, 2022 07:54
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.
@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
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants