Remove legacy unmaintained packages, refactor to support change default locale (#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 commit is contained in:
wxiaoguang authored and GitHub committed 2022-04-03 17:46:48 +08:00
1 parent 27c34dd011
commit d242511e86
26 files changed
+758 -42

No files matched your search

+2 -1
View File
@@ -8,7 +8,8 @@ import (
"fmt"
"net/url"
"github.com/unknwon/i18n"
"code.gitea.io/gitea/modules/translation/i18n"
"github.com/yuin/goldmark/ast"
)