gitea/modules/web/middleware
zeripath b228a0aa44
Use index of the supported tags to choose user lang (#15452) (#15488)
Backport #15452

Fix #14793.

The previous implementation used the first return value of matcher.Match, which is the chosen language tag but may contain extensions such as de-DE-u-rg-chzzzz.

As mentioned in the documentation of language package, matcher.Match also returns the index of the supported tags, so I think it is better to use it rather than manipulate the returned language tag.

Co-authored-by: Naohisa Murakami <tiqwab.ch90@gmail.com>
2021-04-15 16:47:43 +02:00
..
binding.go Move middlewares to web/middleware (#14480) 2021-01-30 10:55:53 +02:00
cookie.go Add SameSite setting for cookies (#14900) 2021-03-07 08:12:43 +00:00
data.go Move middlewares to web/middleware (#14480) 2021-01-30 10:55:53 +02:00
flash.go Move middlewares to web/middleware (#14480) 2021-01-30 10:55:53 +02:00
locale.go Use index of the supported tags to choose user lang (#15452) (#15488) 2021-04-15 16:47:43 +02:00
request.go Move middlewares to web/middleware (#14480) 2021-01-30 10:55:53 +02:00