aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/view_test.go
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2022-10-24 14:12:15 +0800
committerGitHub <noreply@github.com>2022-10-24 14:12:15 +0800
commite1ce45eabf25175d06472fadd01261548a48f1fd (patch)
tree98e0aa65906df3ca8fd8927ad3a022f4a95086cf /routers/web/repo/view_test.go
parent49874b7aadd717d174ded1cd54db88298a5b7afb (diff)
downloadgitea-e1ce45eabf25175d06472fadd01261548a48f1fd.tar.gz
gitea-e1ce45eabf25175d06472fadd01261548a48f1fd.zip
adapt README_{Country}.md stype name in localizedExtensions (#21486)
This stype name is also used in many repos, example: [``README_ZH.md``](https://github.com/go-gitea/gitea/blob/main/README_ZH.md) Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/web/repo/view_test.go')
-rw-r--r--routers/web/repo/view_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/web/repo/view_test.go b/routers/web/repo/view_test.go
index 9d5a88fca4..803906b217 100644
--- a/routers/web/repo/view_test.go
+++ b/routers/web/repo/view_test.go
@@ -38,19 +38,19 @@ func Test_localizedExtensions(t *testing.T) {
name: "With region - lowercase",
languageCode: "en-us",
ext: ".md",
- wantLocalizedExts: []string{".en-us.md", ".en_us.md", ".en.md", ".md"},
+ wantLocalizedExts: []string{".en-us.md", ".en_us.md", ".en.md", "_en.md", ".md"},
},
{
name: "With region - uppercase",
languageCode: "en-CA",
ext: ".MD",
- wantLocalizedExts: []string{".en-ca.MD", ".en_ca.MD", ".en.MD", ".MD"},
+ wantLocalizedExts: []string{".en-ca.MD", ".en_ca.MD", ".en.MD", "_en.MD", ".MD"},
},
{
name: "With region - all uppercase",
languageCode: "ZH-TW",
ext: ".md",
- wantLocalizedExts: []string{".zh-tw.md", ".zh_tw.md", ".zh.md", ".md"},
+ wantLocalizedExts: []string{".zh-tw.md", ".zh_tw.md", ".zh.md", "_zh.md", ".md"},
},
}
for _, tt := range tests {