Add support for a language param

This commit is contained in:
Nat
2025-01-22 12:53:28 +08:00
parent f45936dde5
commit 307b92aead
2 changed files with 7 additions and 1 deletions

View File

@@ -155,6 +155,11 @@ basic:
hidden: true
client: true
validator: "AllowUserLocaleEnabledValidator"
set_locale_from_param:
default: false
hidden: true
client: true
validator: "AllowUserLocaleEnabledValidator"
support_mixed_text_direction:
client: true
default: false

View File

@@ -1215,7 +1215,8 @@ module Discourse
end
def self.anonymous_locale(request)
locale =
locale = request.params["lang"] if SiteSetting.set_locale_from_param
locale ||=
HttpLanguageParser.parse(request.cookies["locale"]) if SiteSetting.set_locale_from_cookie
locale ||=
HttpLanguageParser.parse(