A platform for community discussion. Free, open, simple.
DEV: Remove 'experimental' prefix from settings (#33233)
Natalie Tayfe30ffa3f9ca
diff --git a/app/assets/javascripts/discourse/app/components/composer-action-title.gjs b/app/assets/javascripts/discourse/app/components/composer-action-title.gjsindex a7c528bbcff..a3ead8c1fae 100644--- a/app/assets/javascripts/discourse/app/components/composer-action-title.gjs+++ b/app/assets/javascripts/discourse/app/components/composer-action-title.gjs@@ -73,7 +73,7 @@ export default class ComposerActionTitle extends Component {const allowedActions = [CREATE_TOPIC, EDIT, REPLY];if (this.currentUser &&- this.siteSettings.experimental_content_localization &&+ this.siteSettings.content_localization_enabled &&this.currentUser.can_localize_content &&allowedActions.includes(this.model.action)) {diff --git a/app/assets/javascripts/discourse/app/components/composer-editor.gjs b/app/assets/javascripts/discourse/app/components/composer-editor.gjsindex 7977679fdb0..d3748f32a85 100644--- a/app/assets/javascripts/discourse/app/components/composer-editor.gjs+++ b/app/assets/javascripts/discourse/app/components/composer-editor.gjs@@ -963,7 +963,7 @@ export default class ComposerEditor extends Component {get showTranslationEditor() {if (- !this.siteSettings.experimental_content_localization ||+ !this.siteSettings.content_localization_enabled ||!this.currentUser.can_localize_content) {return false;diff --git a/app/assets/javascripts/discourse/app/components/header/icons.gjs b/app/assets/javascripts/discourse/app/components/header/icons.gjsindex e4c7cfe0c9a..d8c7e9b9341 100644--- a/app/assets/javascripts/discourse/app/components/header/icons.gjs+++ b/app/assets/javascripts/discourse/app/components/header/icons.gjs@@ -70,8 +70,8 @@ export default class Icons extends Component {get showLanguageSwitcher() {return (!this.currentUser &&- this.siteSettings.experimental_anon_language_switcher &&- this.siteSettings.experimental_content_localization_supported_locales+ this.siteSettings.content_localization_anon_language_switcher &&+ this.siteSettings.content_localization_supported_locales);}diff --git a/app/assets/javascripts/discourse/app/components/modal/post-translations.gjs b/app/assets/javascripts/discourse/app/components/modal/post-translations.gjsindex bdfc3ff9aff..1cac252813b 100644--- a/app/assets/javascripts/discourse/app/components/modal/post-translations.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/post-translations.gjs@@ -60,7 +60,7 @@ export default class PostTranslationsModal extends Component {async editLocalization(locale) {if (!this.currentUser ||- !this.siteSettings.experimental_content_localization ||+ !this.siteSettings.content_localization_enabled ||!this.currentUser.can_localize_content) {return;diff --git a/app/assets/javascripts/discourse/app/components/post/menu/buttons/add-translation.gjs b/app/assets/javascripts/discourse/app/components/post/menu/buttons/add-translation.gjsindex 9bfc4e8ae43..a9c88d1a025 100644--- a/app/assets/javascripts/discourse/app/components/post/menu/buttons/add-translation.gjs+++ b/app/assets/javascripts/discourse/app/components/post/menu/buttons/add-translation.gjs@@ -36,7 +36,7 @@ export default class PostMenuAddTranslationButton extends Component {get showTranslationButton() {return (this.currentUser &&- this.siteSettings.experimental_content_localization &&+ this.siteSettings.content_localization_enabled &&this.currentUser.can_localize_content);}@@ -60,7 +60,7 @@ export default class PostMenuAddTranslationButton extends Component {async addTranslation() {if (!this.currentUser ||- !this.siteSettings.experimental_content_localization ||+ !this.siteSettings.content_localization_enabled ||!this.currentUser.can_localize_content) {return;diff --git a/app/assets/javascripts/discourse/app/models/category.js b/app/assets/javascripts/discourse/app/models/category.jsindex 25793e099f6..4a5b2aabfb9 100644--- a/app/assets/javascripts/discourse/app/models/category.js+++ b/app/assets/javascripts/discourse/app/models/category.js@@ -782,7 +782,7 @@ export default class Category extends RestModel {style_type: this.style_type,emoji: this.emoji,icon: this.icon,- ...(this.siteSettings.experimental_content_localization && {+ ...(this.siteSettings.content_localization_enabled && {category_localizations_attributes: this._buildUpdatedLocalizations(),}),}),diff --git a/app/assets/javascripts/discourse/app/templates/edit-category-tabs.gjs b/app/assets/javascripts/discourse/app/templates/edit-category-tabs.gjsindex 8a13e0d9366..8324bf0f488 100644--- a/app/assets/javascripts/discourse/app/templates/edit-category-tabs.gjs+++ b/app/assets/javascripts/discourse/app/templates/edit-category-tabs.gjs@@ -79,7 +79,7 @@ export default RouteTemplate(/>{{/if}}- {{#if @controller.siteSettings.experimental_content_localization}}+ {{#if @controller.siteSettings.content_localization_enabled}}<EditCategoryTab@panels={{@controller.panels}}@selectedTab={{@controller.selectedTab}}diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rbindex f6837f1fe55..7136f49ceac 100644--- a/app/controllers/categories_controller.rb+++ b/app/controllers/categories_controller.rb@@ -540,7 +540,7 @@ class CategoriesController < ApplicationControllerconditional_param_keys << { moderating_group_ids: [] }end- if SiteSetting.experimental_content_localization?+ if SiteSetting.content_localization_enabled?conditional_param_keys << {category_localizations_attributes: %i[id category_id locale name description _destroy],}diff --git a/app/models/category_list.rb b/app/models/category_list.rbindex 293aee8581b..a8e282f7e84 100644--- a/app/models/category_list.rb+++ b/app/models/category_list.rb@@ -140,7 +140,7 @@ class CategoryListdef find_categoriesquery = Category.includes(CategoryList.included_associations).secured(@guardian)- if SiteSetting.experimental_content_localization+ if SiteSetting.content_localization_enabledlocale = I18n.locale.to_squery =query.joins(@@ -173,7 +173,7 @@ class CategoryListquery =DiscoursePluginRegistry.apply_modifier(:category_list_find_categories_query, query, self)- if SiteSetting.experimental_content_localization+ if SiteSetting.content_localization_enabledquery =query.group("categories.id").select("categories.*,diff --git a/app/models/site.rb b/app/models/site.rbindex 1faa8265058..e577b8ca4bb 100644--- a/app/models/site.rb+++ b/app/models/site.rb@@ -84,7 +84,7 @@ class Sitecategory_required_tag_groups: :tag_group,).joins("LEFT JOIN topics t on t.id = categories.topic_id")- if SiteSetting.experimental_content_localization+ if SiteSetting.content_localization_enabledlocale = I18n.locale.to_squery =query.joins(@@ -232,7 +232,7 @@ class Siteendseq = nil- use_localized_anon_cache = SiteSetting.experimental_content_localization && guardian.anonymous?+ use_localized_anon_cache = SiteSetting.content_localization_enabled && guardian.anonymous?locale = I18n.localecache_key = "site_json"diff --git a/app/models/site_setting.rb b/app/models/site_setting.rbindex 28a1d8c944e..18c3fe5e13c 100644--- a/app/models/site_setting.rb+++ b/app/models/site_setting.rb@@ -118,9 +118,9 @@ class SiteSetting < ActiveRecord::Baseclient_settings << :available_content_localization_localesdef self.available_content_localization_locales- return [] if !SiteSetting.experimental_content_localization?+ return [] if !SiteSetting.content_localization_enabled?- supported_locales = SiteSetting.experimental_content_localization_supported_locales.split("|")+ supported_locales = SiteSetting.content_localization_supported_locales.split("|")default_locale = SiteSetting.default_localeif default_locale.present? && !supported_locales.include?(default_locale)supported_locales << default_localediff --git a/app/models/topic_list.rb b/app/models/topic_list.rbindex 11967f3850b..c2cb107b6e7 100644--- a/app/models/topic_list.rb+++ b/app/models/topic_list.rb@@ -138,9 +138,7 @@ class TopicList{ category: :parent_category },]- if SiteSetting.experimental_content_localization- topic_preloader_associations << :topic_localizations- end+ topic_preloader_associations << :topic_localizations if SiteSetting.content_localization_enabledDiscoursePluginRegistry.topic_preloader_associations.each do |a|fields = a[:fields]diff --git a/app/serializers/current_user_serializer.rb b/app/serializers/current_user_serializer.rbindex 3c44aee281c..7b58cdb6588 100644--- a/app/serializers/current_user_serializer.rb+++ b/app/serializers/current_user_serializer.rb@@ -332,7 +332,7 @@ class CurrentUserSerializer < BasicUserSerializerenddef include_can_localize_content?- SiteSetting.experimental_content_localization+ SiteSetting.content_localization_enabledenddef effective_locale@@ -340,6 +340,6 @@ class CurrentUserSerializer < BasicUserSerializerenddef include_effective_locale?- SiteSetting.experimental_content_localization+ SiteSetting.content_localization_enabledendenddiff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rbindex 74aef9586ca..807fcf4e641 100644--- a/app/serializers/post_serializer.rb+++ b/app/serializers/post_serializer.rb@@ -680,7 +680,7 @@ class PostSerializer < BasicPostSerializerenddef include_locale?- SiteSetting.experimental_content_localization+ SiteSetting.content_localization_enabledenddef is_localized@@ -688,7 +688,7 @@ class PostSerializer < BasicPostSerializerenddef include_is_localized?- SiteSetting.experimental_content_localization+ SiteSetting.content_localization_enabledenddef language@@ -696,7 +696,7 @@ class PostSerializer < BasicPostSerializerenddef include_language?- SiteSetting.experimental_content_localization && object.locale.present?+ SiteSetting.content_localization_enabled && object.locale.present?enddef localization_outdateddiff --git a/app/serializers/topic_view_serializer.rb b/app/serializers/topic_view_serializer.rbindex 4370366bcb0..f6104dbf007 100644--- a/app/serializers/topic_view_serializer.rb+++ b/app/serializers/topic_view_serializer.rb@@ -337,6 +337,6 @@ class TopicViewSerializer < ApplicationSerializerenddef include_has_localized_content?- SiteSetting.experimental_content_localization+ SiteSetting.content_localization_enabledendenddiff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex f501e55b516..389a7e36c4f 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -7819,6 +7819,7 @@ en:basic: "Basic Setup"users: "Users"posting: "Posting"+ content_localization: "Content Localization"email: "Email"files: "Files"trust: "Trust Levels"diff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex 67ce92d1c52..ab965645dbb 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -2727,12 +2727,14 @@ en:about_page_extra_groups_order: "Ordering of the extra groups on the about page."adobe_analytics_tags_url: "Adobe Analytics tags URL (`https://assets.adobedtm.com/...`)"view_raw_email_allowed_groups: "Groups which can view the raw email content of a post if it was created by an incoming email. This includes email headers and other technical information."- experimental_content_localization: "Displays localized content for users based on their language preferences. Such content may include categories, tags, posts, and topics. This feature is under heavy development."rich_editor: "Enable the rich editor so all users can switch between the current Markdown mode and the new rich text editor for more intuitive and user-friendly composition. The rich text editor is under active development, so not all features are supported yet — <a href='https://meta.discourse.org/t/test-our-new-composer/352347' target='_blank'>see Meta for more details</a>."- experimental_content_localization_allowed_groups: 'Groups allowed to update localized content. Requires "experimental content localization" to be enabled.'- experimental_content_localization_supported_locales: "List of supported locales that user content can be translated to. Requires `experimental_content_localization` to be enabled to take effect."viewport_based_mobile_mode: "EXPERIMENTAL: Disable the user-agent-based mobile/desktop modes and use viewport width instead."- experimental_anon_language_switcher: "Enable experimental language switcher. This will allow site visitors who are not logged in to switch between translated versions of Discourse and user-contributed content in topics."++ content_localization_enabled: "Displays localized content for users based on their browser or user language preferences. Such content may include categories, tags, posts, and topics. Supported locales are set in 'content localization supported locales'."+ content_localization_supported_locales: "List of supported locales that user content can be translated to. Requires 'content localization enabled'."+ content_localization_allowed_groups: "Groups allowed to update localized content. Requires 'content localization enabled'."+ content_localization_anon_language_switcher: "Enable language switcher which allows site visitors who are not logged in to switch between translated versions of Discourse and user-contributed content. Depends on the list of languages defined in 'content localization supported locales'"+errors:invalid_css_color: "Invalid color. Enter a color name or hex value."invalid_email: "Invalid email address."@@ -2802,7 +2804,7 @@ en:delete_rejected_email_after_days: "This setting cannot be set lower than the delete_email_logs_after_days setting or greater than %{max}"invalid_uncategorized_category_setting: 'The "Uncategorized" category cannot be selected if ''allow uncategorized topics'' is not enabled.'invalid_search_ranking_weights: "Value is invalid for search_ranking_weights site setting. Example: '{0.1,0.2,0.3,1.0}'. Note that maximum value for each weight is 1.0."- experimental_anon_language_switcher_requirements: "The experimental language switcher requires the `set locale from cookie` site setting to be enabled, and the `automatic translation target languages` to have at least one language."+ content_localization_anon_language_switcher_requirements: "The language switcher requires the `set locale from cookie` site setting to be enabled, and the `content localization supported locales` to have at least one language."keywords:clean_up_inactive_users_after_days: "deactivated|inactive|unactivated"@@ -5775,6 +5777,3 @@ en:duplicate_ids: "has duplicate ids"reserved_id: "has a reserved keyword as id: %{id}"unsafe_description: "has an unsafe HTML description"-- content_localization:- not_allowed: "You are not allowed to localize this content."diff --git a/config/site_settings.yml b/config/site_settings.ymlindex 954cc1329e0..5eab5be55b0 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -1596,6 +1596,31 @@ posting:min: 1hidden: true+content_localization:+ content_localization_enabled:+ client: true+ default: false+ area: "localization"+ content_localization_allowed_groups:+ type: group_list+ list_type: compact+ allow_any: false+ client: true+ default: "1|2" # admin, moderator+ area: "localization"+ content_localization_supported_locales:+ default: ""+ type: list+ client: true+ list_type: named+ allow_any: false+ choices: "LocaleSiteSetting.values"+ area: "localization"+ content_localization_anon_language_switcher:+ default: false+ client: true+ validator: "LanguageSwitcherSettingValidator"+email:email_time_window_mins:default: 10@@ -4018,29 +4043,6 @@ experimental:rich_editor:client: truedefault: false- experimental_content_localization:- client: true- default: false- area: "localization"- experimental_content_localization_allowed_groups:- type: group_list- list_type: compact- allow_any: false- client: true- default: "1|2" # admin, moderator- area: "localization"- experimental_content_localization_supported_locales:- default: ""- type: list- client: true- list_type: named- allow_any: false- choices: "LocaleSiteSetting.values"- area: "localization"- experimental_anon_language_switcher:- default: false- client: true- validator: "LanguageSwitcherSettingValidator"experimental_system_themes:type: listdefault: ""diff --git a/db/migrate/20250617085536_remove_experimental_from_content_localization_settings.rb b/db/migrate/20250617085536_remove_experimental_from_content_localization_settings.rbnew file mode 100644index 00000000000..092d260ea7e--- /dev/null+++ b/db/migrate/20250617085536_remove_experimental_from_content_localization_settings.rb@@ -0,0 +1,14 @@+# frozen_string_literal: true++class RemoveExperimentalFromContentLocalizationSettings < ActiveRecord::Migration[7.2]+ def up+ execute "UPDATE site_settings SET name = 'content_localization_enabled' WHERE name = 'experimental_content_localization'"+ execute "UPDATE site_settings SET name = 'content_localization_allowed_groups' WHERE name = 'experimental_content_localization_allowed_groups'"+ execute "UPDATE site_settings SET name = 'content_localization_supported_locales' WHERE name = 'experimental_content_localization_supported_locales'"+ execute "UPDATE site_settings SET name = 'content_localization_anon_language_switcher' WHERE name = 'experimental_anon_language_switcher'"+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/lib/content_localization.rb b/lib/content_localization.rbindex 7732829dde1..22077a0bfe4 100644--- a/lib/content_localization.rb+++ b/lib/content_localization.rb@@ -14,7 +14,7 @@ class ContentLocalization# @param post [Post] The post object# @return [Boolean]def self.show_translated_post?(post, scope)- SiteSetting.experimental_content_localization && post.raw.present? && post.locale.present? &&+ SiteSetting.content_localization_enabled && post.raw.present? && post.locale.present? &&!post.in_user_locale? && !show_original?(scope)end@@ -23,7 +23,7 @@ class ContentLocalization# @param topic [Topic] The topic record# @return [Boolean]def self.show_translated_topic?(topic, scope)- SiteSetting.experimental_content_localization && topic.locale.present? &&- !topic.in_user_locale? && !show_original?(scope)+ SiteSetting.content_localization_enabled && topic.locale.present? && !topic.in_user_locale? &&+ !show_original?(scope)endenddiff --git a/lib/guardian/localization_guardian.rb b/lib/guardian/localization_guardian.rbindex f7b2cbef0f5..5f03f18a1d2 100644--- a/lib/guardian/localization_guardian.rb+++ b/lib/guardian/localization_guardian.rb@@ -2,7 +2,7 @@module LocalizationGuardiandef can_localize_content?- return false if !SiteSetting.experimental_content_localization- user.in_any_groups?(SiteSetting.experimental_content_localization_allowed_groups_map)+ return false if !SiteSetting.content_localization_enabled+ user.in_any_groups?(SiteSetting.content_localization_allowed_groups_map)endenddiff --git a/lib/validators/language_switcher_setting_validator.rb b/lib/validators/language_switcher_setting_validator.rbindex c96dd10f50a..2e6dbb42225 100644--- a/lib/validators/language_switcher_setting_validator.rb+++ b/lib/validators/language_switcher_setting_validator.rb@@ -8,10 +8,10 @@ class LanguageSwitcherSettingValidatordef valid_value?(val)return true if val == "f" || val == "false"SiteSetting.set_locale_from_cookie &&- SiteSetting.experimental_content_localization_supported_locales.present?+ SiteSetting.content_localization_supported_locales.present?enddef error_message- I18n.t("site_settings.errors.experimental_anon_language_switcher_requirements")+ I18n.t("site_settings.errors.content_localization_anon_language_switcher_requirements")endenddiff --git a/spec/lib/content_localization_spec.rb b/spec/lib/content_localization_spec.rbindex 7b6cec2b260..fe12a0ae123 100644--- a/spec/lib/content_localization_spec.rb+++ b/spec/lib/content_localization_spec.rb@@ -24,7 +24,7 @@ describe ContentLocalization dofab!(:post)it "returns true when criteria met" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truepost.update!(locale: "ja")I18n.locale = "de"scope = create_scope@@ -34,13 +34,13 @@ describe ContentLocalization docontext "when criteria not met" dobefore do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truepost.update!(locale: "ja")I18n.locale = "de"end- it "returns false when experimental_content_localization is false" do- SiteSetting.experimental_content_localization = false+ it "returns false when content_localization_enabled is false" do+ SiteSetting.content_localization_enabled = falsescope = create_scopeexpect(ContentLocalization.show_translated_post?(post, scope)).to be false@@ -79,7 +79,7 @@ describe ContentLocalization dofab!(:topic)it "returns true when criteria met" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truetopic.update!(locale: "ja")I18n.locale = "de"scope = create_scope@@ -89,13 +89,13 @@ describe ContentLocalization docontext "when criteria not met" dobefore do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truetopic.update!(locale: "ja")I18n.locale = "de"end- it "returns false when experimental_content_localization is false" do- SiteSetting.experimental_content_localization = false+ it "returns false when content_localization_enabled is false" do+ SiteSetting.content_localization_enabled = falsescope = create_scopeexpect(ContentLocalization.show_translated_topic?(topic, scope)).to be falsediff --git a/spec/lib/post_localization_creator_spec.rb b/spec/lib/post_localization_creator_spec.rbindex 56064fc6897..38919551b15 100644--- a/spec/lib/post_localization_creator_spec.rb+++ b/spec/lib/post_localization_creator_spec.rb@@ -9,8 +9,8 @@ describe PostLocalizationCreator dolet(:raw) { "これは翻訳です。" }before do- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = group.id.to_s+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = group.id.to_sgroup.add(user)enddiff --git a/spec/lib/post_localization_destroyer_spec.rb b/spec/lib/post_localization_destroyer_spec.rbindex f6e7e2be00d..2b1dec777d2 100644--- a/spec/lib/post_localization_destroyer_spec.rb+++ b/spec/lib/post_localization_destroyer_spec.rb@@ -9,8 +9,8 @@ describe PostLocalizationDestroyer dolet(:locale) { "ja" }before do- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = group.id.to_s+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = group.id.to_sgroup.add(user)enddiff --git a/spec/lib/post_localization_updater_spec.rb b/spec/lib/post_localization_updater_spec.rbindex 1c8454af1fe..f71dc12c422 100644--- a/spec/lib/post_localization_updater_spec.rb+++ b/spec/lib/post_localization_updater_spec.rb@@ -12,8 +12,8 @@ describe PostLocalizationUpdater dolet(:new_raw) { "新しいバージョンです" }before do- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = group.id.to_s+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = group.id.to_sgroup.add(user)enddiff --git a/spec/lib/topic_localization_creator_spec.rb b/spec/lib/topic_localization_creator_spec.rbindex 943fa3c100e..2e9b6a73ea8 100644--- a/spec/lib/topic_localization_creator_spec.rb+++ b/spec/lib/topic_localization_creator_spec.rb@@ -9,8 +9,8 @@ describe TopicLocalizationCreator dolet(:title) { "これは翻訳です" }before do- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = group.id.to_s+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = group.id.to_sgroup.add(user)enddiff --git a/spec/lib/topic_localization_destroyer_spec.rb b/spec/lib/topic_localization_destroyer_spec.rbindex c03db7fe4a2..94ce7278ae7 100644--- a/spec/lib/topic_localization_destroyer_spec.rb+++ b/spec/lib/topic_localization_destroyer_spec.rb@@ -9,8 +9,8 @@ describe TopicLocalizationDestroyer dolet(:locale) { "ja" }before do- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = group.id.to_s+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = group.id.to_sgroup.add(user)enddiff --git a/spec/lib/topic_localization_updater_spec.rb b/spec/lib/topic_localization_updater_spec.rbindex dac9d82a34a..b674f568ac5 100644--- a/spec/lib/topic_localization_updater_spec.rb+++ b/spec/lib/topic_localization_updater_spec.rb@@ -12,8 +12,8 @@ describe TopicLocalizationUpdater dolet(:new_title) { "新しいバージョンです" }before do- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = group.id.to_s+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = group.id.to_sgroup.add(user)enddiff --git a/spec/models/category_list_spec.rb b/spec/models/category_list_spec.rbindex a5566455743..6c5d2a3d8fa 100644--- a/spec/models/category_list_spec.rb+++ b/spec/models/category_list_spec.rb@@ -499,14 +499,14 @@ RSpec.describe CategoryList doendend- context "with experimental_content_localization enabled" do+ context "with content_localization_enabled enabled" dofab!(:category) { Fabricate(:category, name: "Original Name", description: "Original Desc") }fab!(:category_localization) { Fabricate(:category_localization, category:, locale: "ja") }let(:locale) { "ja" }before do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = trueI18n.locale = localeenddiff --git a/spec/models/site_spec.rb b/spec/models/site_spec.rbindex 91c6f6bed0c..d168f4d1c77 100644--- a/spec/models/site_spec.rb+++ b/spec/models/site_spec.rb@@ -345,9 +345,9 @@ RSpec.describe Site do)end- describe "experimental_content_localization" do+ describe "content_localization_enabled" doit "returns localized category names when enabled" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truelocalization = Fabricate(:category_localization)category = localization.category@@ -362,7 +362,7 @@ RSpec.describe Site doendit "returns original names when enabled" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truecategory = Fabricate(:category, name: "derp", description: "derp derp")@@ -390,8 +390,8 @@ RSpec.describe Site doI18n.locale = original_localeend- context "when experimental_content_localization is disabled" do- before { SiteSetting.experimental_content_localization = false }+ context "when content_localization_enabled is disabled" do+ before { SiteSetting.content_localization_enabled = false }it "caches anon site json with a global key (not locale scoped)" doexpect(Discourse.redis.get("site_json")).to be_nil@@ -410,8 +410,8 @@ RSpec.describe Site doendend- context "when experimental_content_localization is enabled" do- before { SiteSetting.experimental_content_localization = true }+ context "when content_localization_enabled is enabled" do+ before { SiteSetting.content_localization_enabled = true }it "caches anon site json separately for each locale" doexpect(Discourse.redis.get("site_json_en")).to be_nildiff --git a/spec/models/topic_spec.rb b/spec/models/topic_spec.rbindex ec8c2da1a4e..0b2326fc45b 100644--- a/spec/models/topic_spec.rb+++ b/spec/models/topic_spec.rb@@ -1714,7 +1714,7 @@ describe Topic doendit "returns a localized banner" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truefirst_post.update!(locale: "en")I18n.locale = :jadiff --git a/spec/requests/post_localizations_controller_spec.rb b/spec/requests/post_localizations_controller_spec.rbindex 6f4477f61fb..28d1323430f 100644--- a/spec/requests/post_localizations_controller_spec.rb+++ b/spec/requests/post_localizations_controller_spec.rb@@ -9,8 +9,8 @@ describe PostLocalizationsController dolet(:raw) { "これは翻訳です。" }before do- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = group.id.to_s+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = group.id.to_sgroup.add(user)sign_in(user)enddiff --git a/spec/requests/topic_localizations_controller_spec.rb b/spec/requests/topic_localizations_controller_spec.rbindex 24a83993a3d..4a49230b4b1 100644--- a/spec/requests/topic_localizations_controller_spec.rb+++ b/spec/requests/topic_localizations_controller_spec.rb@@ -9,8 +9,8 @@ describe TopicLocalizationsController dolet(:title) { "これはトピックの翻訳です。" }before do- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = group.id.to_s+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = group.id.to_sgroup.add(user)sign_in(user)enddiff --git a/spec/serializers/basic_post_serializer_spec.rb b/spec/serializers/basic_post_serializer_spec.rbindex 25aa3baa76d..f958f97fb2b 100644--- a/spec/serializers/basic_post_serializer_spec.rb+++ b/spec/serializers/basic_post_serializer_spec.rb@@ -23,7 +23,7 @@ RSpec.describe BasicPostSerializer doendit "returns the localized cooked" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = trueFabricate(:post_localization, post: post, cooked: "X", locale: "ja")I18n.locale = "ja"post.update!(locale: "en")diff --git a/spec/serializers/basic_topic_serializer_spec.rb b/spec/serializers/basic_topic_serializer_spec.rbindex fbc8a667518..33d40933655 100644--- a/spec/serializers/basic_topic_serializer_spec.rb+++ b/spec/serializers/basic_topic_serializer_spec.rb@@ -11,7 +11,7 @@ describe BasicTopicSerializer doendit "returns the fancy title with a modifier" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = trueFabricate(:topic_localization, topic:, fancy_title: "X", locale: "ja")I18n.locale = "ja"topic.update!(locale: "en")diff --git a/spec/serializers/listable_topic_serializer_spec.rb b/spec/serializers/listable_topic_serializer_spec.rbindex 31e63f78e42..d45452e9896 100644--- a/spec/serializers/listable_topic_serializer_spec.rb+++ b/spec/serializers/listable_topic_serializer_spec.rb@@ -46,7 +46,7 @@ describe ListableTopicSerializer dotopic.update!(locale: "en")Fabricate(:topic_localization, topic:, excerpt: "X", locale: "ja")- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = trueSiteSetting.always_include_topic_excerpts = truejson = ListableTopicSerializer.new(topic, scope: Guardian.new).as_jsondiff --git a/spec/serializers/post_serializer_spec.rb b/spec/serializers/post_serializer_spec.rbindex d902b26721c..789ffb84429 100644--- a/spec/serializers/post_serializer_spec.rb+++ b/spec/serializers/post_serializer_spec.rb@@ -713,7 +713,7 @@ RSpec.describe PostSerializer doendit "returns the localized raw" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = trueFabricate(:post_localization, post: post, raw: "raw", locale: "ja")I18n.locale = "ja"post.update!(locale: "en")@@ -726,15 +726,15 @@ RSpec.describe PostSerializer dolet(:serializer) { serialized_post }let(:json) { serializer.as_json }- it "is included when experimental_content_localization is enabled" do- SiteSetting.experimental_content_localization = true+ it "is included when content_localization_enabled is enabled" do+ SiteSetting.content_localization_enabled = truepost.update!(locale: "ja")expect(json[:locale]).to eq("ja")end- it "is excluded when experimental_content_localization is disabled" do- SiteSetting.experimental_content_localization = false+ it "is excluded when content_localization_enabled is disabled" do+ SiteSetting.content_localization_enabled = falsepost.update!(locale: "ja")expect(json[:locale]).to eq(nil)@@ -745,15 +745,15 @@ RSpec.describe PostSerializer dolet(:serializer) { serialized_post }let(:json) { serializer.as_json }- it "is excluded when experimental_content_localization is disabled" do- SiteSetting.experimental_content_localization = false+ it "is excluded when content_localization_enabled is disabled" do+ SiteSetting.content_localization_enabled = falseexpect(json[:is_localized]).to eq(nil)enddescribe "content localization enabled" dobefore do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = trueI18n.locale = "en"end@@ -783,25 +783,25 @@ RSpec.describe PostSerializer dolet(:serializer) { serialized_post }let(:json) { serializer.as_json }- it "is excluded when experimental_content_localization is disabled or no locale" do- SiteSetting.experimental_content_localization = false+ it "is excluded when content_localization_enabled is disabled or no locale" do+ SiteSetting.content_localization_enabled = falsepost.update!(locale: "ja")expect(serializer.as_json[:language]).to eq(nil)- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truepost.update!(locale: nil)expect(serializer.as_json[:language]).to eq(nil)endit "shows the language of the post based on locale" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truepost.update!(locale: "ja")expect(json[:language]).to eq("日本語")endit "defaults to locale if language does not exist" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truepost.update!(locale: "aa")expect(json[:language]).to eq("aa")@@ -812,13 +812,13 @@ RSpec.describe PostSerializer dolet(:serializer) { serialized_post }let(:json) { serializer.as_json }- it "is excluded when experimental_content_localization is disabled" do- SiteSetting.experimental_content_localization = false+ it "is excluded when content_localization_enabled is disabled" do+ SiteSetting.content_localization_enabled = falseexpect(json[:localization_outdated]).to eq(nil)endit "is true when the post is localized and the localization is outdated" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truepost.update!(locale: "ja", version: 3)Fabricate(:post_localization, post:, locale: "en", post_version: 2)@@ -826,7 +826,7 @@ RSpec.describe PostSerializer doendit "is false when the post is localized and the localization is not outdated" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = truepost.update!(locale: "ja", version: 10)Fabricate(:post_localization, post:, locale: "en", post_version: 10)diff --git a/spec/serializers/topic_view_serializer_spec.rb b/spec/serializers/topic_view_serializer_spec.rbindex 3216bf9fd68..06ddde23328 100644--- a/spec/serializers/topic_view_serializer_spec.rb+++ b/spec/serializers/topic_view_serializer_spec.rb@@ -655,7 +655,7 @@ RSpec.describe TopicViewSerializer doendit "returns the localized fancy_title" do- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = trueFabricate(:topic_localization, topic:, fancy_title: "X", locale: "ja")I18n.locale = "ja"topic.update!(locale: "en")@@ -666,7 +666,7 @@ RSpec.describe TopicViewSerializer doenddescribe "#has_localized_content" do- before { SiteSetting.experimental_content_localization = true }+ before { SiteSetting.content_localization_enabled = true }it "returns true if the topic has localization" doFabricate(:topic_localization, topic:, locale: "ja")@@ -692,7 +692,7 @@ RSpec.describe TopicViewSerializer doendit "does not return attribute if setting is disabled" do- SiteSetting.experimental_content_localization = false+ SiteSetting.content_localization_enabled = falsejson = serialize_topic(topic, user)expect(json[:has_localized_content]).to eq(nil)diff --git a/spec/system/anon_language_switcher_spec.rb b/spec/system/anon_language_switcher_spec.rbindex bb25b5ae4f7..333e47743a8 100644--- a/spec/system/anon_language_switcher_spec.rb+++ b/spec/system/anon_language_switcher_spec.rb@@ -15,19 +15,19 @@ RSpec.describe "Anonymous user language switcher", type: :system dobefore doSiteSetting.default_locale = "en"- SiteSetting.experimental_content_localization_supported_locales = "es|ja"- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_supported_locales = "es|ja"+ SiteSetting.content_localization_enabled = trueSiteSetting.allow_user_locale = trueSiteSetting.set_locale_from_cookie = trueendit "only shows the language switcher based on what is in target languages" do- SiteSetting.experimental_anon_language_switcher = false+ SiteSetting.content_localization_anon_language_switcher = falsevisit("/")expect(page).not_to have_css(SWITCHER_SELECTOR)- SiteSetting.experimental_anon_language_switcher = true+ SiteSetting.content_localization_anon_language_switcher = truevisit("/")switcher.expand@@ -35,7 +35,7 @@ RSpec.describe "Anonymous user language switcher", type: :system doexpect(switcher).to have_content("日本語")expect(switcher).to have_content("Español")- SiteSetting.experimental_content_localization_supported_locales = "es"+ SiteSetting.content_localization_supported_locales = "es"visit("/")switcher.expanddiff --git a/spec/system/edit_category_localizations_spec.rb b/spec/system/edit_category_localizations_spec.rbindex 6e03355cf24..467e0f3346a 100644--- a/spec/system/edit_category_localizations_spec.rb+++ b/spec/system/edit_category_localizations_spec.rb@@ -11,7 +11,7 @@ describe "Edit Category Localizations", type: :system dobefore { sign_in(admin) }context "when content localization setting is disabled" do- before { SiteSetting.experimental_content_localization = false }+ before { SiteSetting.content_localization_enabled = false }it "should not show the localization tab" docategory_page.visit_settings(category)@@ -22,9 +22,9 @@ describe "Edit Category Localizations", type: :system docontext "when content localization setting is enabled" dobefore doSiteSetting.default_locale = "en"- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_supported_locales = "es|fr"- SiteSetting.experimental_content_localization_allowed_groups = Group::AUTO_GROUPS[:everyone]+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_supported_locales = "es|fr"+ SiteSetting.content_localization_allowed_groups = Group::AUTO_GROUPS[:everyone]if SiteSetting.client_settings.exclude?(:available_content_localization_locales)SiteSetting.client_settings << :available_content_localization_localesdiff --git a/spec/system/post_translation_spec.rb b/spec/system/post_translation_spec.rbindex fdb59427432..69725b86b67 100644--- a/spec/system/post_translation_spec.rb+++ b/spec/system/post_translation_spec.rb@@ -19,9 +19,9 @@ describe "Post translations", type: :system dobefore dosign_in(admin)SiteSetting.default_locale = "en"- SiteSetting.experimental_content_localization_supported_locales = "fr|es|pt_BR"- SiteSetting.experimental_content_localization = true- SiteSetting.experimental_content_localization_allowed_groups = Group::AUTO_GROUPS[:everyone]+ SiteSetting.content_localization_supported_locales = "fr|es|pt_BR"+ SiteSetting.content_localization_enabled = true+ SiteSetting.content_localization_allowed_groups = Group::AUTO_GROUPS[:everyone]SiteSetting.post_menu ="read|like|copyLink|flag|edit|bookmark|delete|admin|reply|addTranslation"enddiff --git a/spec/system/topic_view/localized_content_spec.rb b/spec/system/topic_view/localized_content_spec.rbindex c6ce8fb82e1..0aae80f59fe 100644--- a/spec/system/topic_view/localized_content_spec.rb+++ b/spec/system/topic_view/localized_content_spec.rb@@ -41,7 +41,7 @@ RSpec.describe "Localized topic" docontext "when the feature is enabled" dobefore doSiteSetting.allow_user_locale = true- SiteSetting.experimental_content_localization = true+ SiteSetting.content_localization_enabled = trueendit "shows the correct language based on the selected language and login status" do