-
-
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
Unify and simplify TrN for i18n #18141
Conversation
5ccd327
to
9e485d8
Compare
f96e6af
to
67a26dd
Compare
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This comment has been minimized.
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{ |
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.
Off-Topic:
I didn't knew about this one, is this documented somewhere for translators?
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 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
# Conflicts: # routers/web/repo/migrate.go # routers/web/repo/repo.go # routers/web/repo/setting.go
* 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) ...
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.
Refer: #18135 (comment)
Now we have a unique and simple
TrN
, and make the fix of PR #18135 also use the betterTrN
logic.