Remove legacy unmaintained packages, refactor to support change default locale#19308
Merged
Conversation
645d36a to
ee09954
Compare
This comment was marked as outdated.
This comment was marked as outdated.
061e0b7 to
6d014ce
Compare
lafriks
approved these changes
Apr 2, 2022
Member
|
One future idea regarding |
Gusted
reviewed
Apr 2, 2022
Gusted
approved these changes
Apr 3, 2022
Contributor
Gusted
left a comment
There was a problem hiding this comment.
LGTM! Always great to refactor away packages(less binary size 😉)
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Apr 3, 2022
* 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)
AbdulrhmnGhanem
pushed a commit
to kitspace/gitea
that referenced
this pull request
Aug 24, 2022
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows
unknwon/compackage, improve golangci lint #19284 (comment)This PR removes two unmaintained vendor packages
i18nandpaginaterChanges:
i18npackage with a more clear fallback mechanism. Fix an unstableTrbehavior.i18nstill keeps the old name. In future, many code can be merged together with thetranslationpackage.locale.Tr("the.key")directly, without the redundant$.Lang.i18n.PaginatertoPaginator, 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:
Details