mirror of
https://github.com/discourse/discourse.git
synced 2025-02-11 22:04:58 +00:00
DEV: Unhide the set_locale_from_cookie setting to allow site translations (#30924)
Related: https://github.com/discourse/discourse-translator/pull/198 The new experimental feature on discourse-translator requires this `SiteSetting.set_locale_from_cookie` to be set. This comment unhides the existing site setting.
This commit is contained in:
parent
2c8f07fe85
commit
daab816a37
@ -1736,6 +1736,7 @@ en:
|
||||
default_locale: "The default language of this Discourse instance. You can replace the text of system generated categories and topics at <a href='%{base_path}/admin/customize/site_texts' target='_blank'>Customize / Text</a>."
|
||||
allow_user_locale: "Allow users to choose their own language interface preference"
|
||||
set_locale_from_accept_language_header: "set interface language for anonymous users from their web browser's language headers"
|
||||
set_locale_from_cookie: "Allows setting an anonymous user's locale via the 'locale' browser cookie"
|
||||
support_mixed_text_direction: "Support mixed left-to-right and right-to-left text directions."
|
||||
min_post_length: "Minimum allowed post length in characters (excluding personal messages)"
|
||||
min_first_post_length: "Minimum allowed first post (topic body) length (excluding personal messages)"
|
||||
|
@ -152,7 +152,6 @@ basic:
|
||||
validator: "AllowUserLocaleEnabledValidator"
|
||||
set_locale_from_cookie:
|
||||
default: false
|
||||
hidden: true
|
||||
client: true
|
||||
validator: "AllowUserLocaleEnabledValidator"
|
||||
support_mixed_text_direction:
|
||||
|
@ -47,11 +47,9 @@ RSpec.describe Admin::SiteSettingsController do
|
||||
Admin::Config::SiteSettingsController::ADMIN_CONFIG_AREA_ALLOWLISTED_HIDDEN_SETTINGS.first.to_s
|
||||
end,
|
||||
).to be_present
|
||||
get "/admin/config/site_settings.json", params: { filter_names: ["set_locale_from_cookie"] }
|
||||
get "/admin/config/site_settings.json", params: { filter_names: ["max_category_nesting"] }
|
||||
expect(
|
||||
response.parsed_body["site_settings"].find do |s|
|
||||
s["setting"] == "set_locale_from_cookie"
|
||||
end,
|
||||
response.parsed_body["site_settings"].find { |s| s["setting"] == "max_category_nesting" },
|
||||
).to be_nil
|
||||
end
|
||||
|
||||
|
@ -25,9 +25,7 @@ RSpec.describe Admin::SiteSettingsController do
|
||||
get "/admin/site_settings.json"
|
||||
expect(response.status).to eq(200)
|
||||
expect(
|
||||
response.parsed_body["site_settings"].find do |s|
|
||||
s["setting"] == "set_locale_from_cookie"
|
||||
end,
|
||||
response.parsed_body["site_settings"].find { |s| s["setting"] == "max_category_nesting" },
|
||||
).to be_nil
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user