-
-
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
Remove legacy unmaintained packages, refactor to support change default locale #19308
Conversation
645d36a
to
ee09954
Compare
This comment was marked as outdated.
This comment was marked as outdated.
061e0b7
to
6d014ce
Compare
One future idea regarding |
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.
LGTM! Always great to refactor away packages(less binary size 😉)
* giteaofficial/main: Remove legacy unmaintained packages, refactor to support change default locale (go-gitea#19308) [skip ci] Updated translations via Crowdin Prevent intermittent NPE in queue tests (go-gitea#19301) Upgrade xorm/builder from v0.3.9 to v0.3.10 (go-gitea#19296) An attempt to sync a non-mirror repo must give 400 (Bad Request) (go-gitea#19300) Remove legacy `unknwon/com` package (go-gitea#19298) Improve package registry docs (go-gitea#19273) A pull-mirror repo should be marked as such on creation (go-gitea#19295) Refactor legacy `unknwon/com` package, improve golangci lint (go-gitea#19284) Skip frontend ROOT_URL check on installation page, remove unnecessary global var (go-gitea#19291)
…lt locale (go-gitea#19308) Remove two unmaintained vendor packages `i18n` and `paginater`. Changes: * Rewrite `i18n` package with a more clear fallback mechanism. Fix an unstable `Tr` behavior, add more tests. * Refactor the legacy `Paginater` to `Paginator`, test cases are kept unchanged. Trivial enhancement (no breaking for end users): * Use the first locale in LANGS setting option as the default, add a log to prevent from surprising users.
Follows
unknwon/com
package, improve golangci lint #19284 (comment)This PR removes two unmaintained vendor packages
i18n
andpaginater
Changes:
i18n
package with a more clear fallback mechanism. Fix an unstableTr
behavior.i18n
still keeps the old name. In future, many code can be merged together with thetranslation
package.locale.Tr("the.key")
directly, without the redundant$.Lang
.i18n
.Paginater
toPaginator
, test cases are kept unchanged.Trivial enhancement (no breaking for end users):
i18n.DefaultLocales.SetDefaultLang(setting.Langs[0])
, and there is a log to prevent from surprising users.The UI with i18n still works as before (of course ...), screenshot: