Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
< 3.5.0.beta7-dev: cd14b0c0bee0cf63c59b64b6f7213e31a37f11a7
< 3.5.0.beta6-dev: 3e74eea1e5e3143888d67a8d8a11206df214dc24
< 3.5.0.beta3-dev: 09a68414804a1447f52e5d60691ba59742cda9ec
< 3.5.0.beta2-dev: de8624416a15b3d8e7ad350b083cc1420451ccec
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/regular/detect_translate_post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def execute(args)
end
end

locales = SiteSetting.experimental_content_localization_supported_locales.split("|")
locales = SiteSetting.content_localization_supported_locales.split("|")
return if locales.blank?

locales.each do |locale|
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/regular/detect_translate_topic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def execute(args)
end
end

locales = SiteSetting.experimental_content_localization_supported_locales.split("|")
locales = SiteSetting.content_localization_supported_locales.split("|")
return if locales.blank?

locales.each do |locale|
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/regular/localize_categories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def execute(args)
return if !SiteSetting.discourse_ai_enabled
return if !SiteSetting.ai_translation_enabled

locales = SiteSetting.experimental_content_localization_supported_locales.split("|")
locales = SiteSetting.content_localization_supported_locales.split("|")
return if locales.blank?

cat_id = args[:from_category_id] || Category.order(:id).first&.id
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/regular/localize_posts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def execute(args)
return if !SiteSetting.discourse_ai_enabled
return if !SiteSetting.ai_translation_enabled

locales = SiteSetting.experimental_content_localization_supported_locales.split("|")
locales = SiteSetting.content_localization_supported_locales.split("|")
return if locales.blank?

limit = args[:limit] || BATCH_SIZE
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/regular/localize_topics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def execute(args)
return if !SiteSetting.discourse_ai_enabled
return if !SiteSetting.ai_translation_enabled

locales = SiteSetting.experimental_content_localization_supported_locales.split("|")
locales = SiteSetting.content_localization_supported_locales.split("|")
return if locales.blank?

limit = args[:limit] || BATCH_SIZE
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/scheduled/category_localization_backfill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CategoryLocalizationBackfill < ::Jobs::Scheduled
def execute(args)
return if !SiteSetting.discourse_ai_enabled
return if !SiteSetting.ai_translation_enabled
return if SiteSetting.experimental_content_localization_supported_locales.blank?
return if SiteSetting.content_localization_supported_locales.blank?

Jobs.enqueue(:localize_categories)
end
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/scheduled/post_localization_backfill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def execute(args)
return if !SiteSetting.discourse_ai_enabled
return if !SiteSetting.ai_translation_enabled

return if SiteSetting.experimental_content_localization_supported_locales.blank?
return if SiteSetting.content_localization_supported_locales.blank?
return if SiteSetting.ai_translation_backfill_rate == 0

Jobs.enqueue(:localize_posts, limit: SiteSetting.ai_translation_backfill_rate)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/scheduled/topic_localization_backfill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def execute(args)
return if !SiteSetting.discourse_ai_enabled
return if !SiteSetting.ai_translation_enabled

return if SiteSetting.experimental_content_localization_supported_locales.blank?
return if SiteSetting.content_localization_supported_locales.blank?
return if SiteSetting.ai_translation_backfill_rate == 0

Jobs.enqueue(:localize_topics, limit: SiteSetting.ai_translation_backfill_rate)
Expand Down
4 changes: 2 additions & 2 deletions spec/jobs/regular/detect_translate_post_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SiteSetting.public_send("ai_translation_model=", "custom:#{fake_llm.id}")
end
SiteSetting.ai_translation_enabled = true
SiteSetting.experimental_content_localization_supported_locales = locales.join("|")
SiteSetting.content_localization_supported_locales = locales.join("|")
end

it "does nothing when translator is disabled" do
Expand Down Expand Up @@ -55,7 +55,7 @@
end

it "does not translate when no target languages are configured" do
SiteSetting.experimental_content_localization_supported_locales = ""
SiteSetting.content_localization_supported_locales = ""
DiscourseAi::Translation::PostLocaleDetector.expects(:detect_locale).with(post).returns("en")
DiscourseAi::Translation::PostLocalizer.expects(:localize).never

Expand Down
4 changes: 2 additions & 2 deletions spec/jobs/regular/detect_translate_topic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SiteSetting.public_send("ai_translation_model=", "custom:#{fake_llm.id}")
end
SiteSetting.ai_translation_enabled = true
SiteSetting.experimental_content_localization_supported_locales = locales.join("|")
SiteSetting.content_localization_supported_locales = locales.join("|")
end

it "does nothing when translator is disabled" do
Expand Down Expand Up @@ -55,7 +55,7 @@
end

it "does not translate when no target languages are configured" do
SiteSetting.experimental_content_localization_supported_locales = ""
SiteSetting.content_localization_supported_locales = ""
DiscourseAi::Translation::TopicLocaleDetector.expects(:detect_locale).with(topic).returns("en")
DiscourseAi::Translation::TopicLocalizer.expects(:localize).never

Expand Down
4 changes: 2 additions & 2 deletions spec/jobs/regular/localize_categories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def localize_all_categories(*locales)
SiteSetting.public_send("ai_translation_model=", "custom:#{fake_llm.id}")
end
SiteSetting.ai_translation_enabled = true
SiteSetting.experimental_content_localization_supported_locales = "pt|zh_CN"
SiteSetting.content_localization_supported_locales = "pt|zh_CN"

Jobs.run_immediately!
end
Expand All @@ -37,7 +37,7 @@ def localize_all_categories(*locales)
end

it "does nothing when no target languages are configured" do
SiteSetting.experimental_content_localization_supported_locales = ""
SiteSetting.content_localization_supported_locales = ""

DiscourseAi::Translation::CategoryLocalizer.expects(:localize).never

Expand Down
8 changes: 4 additions & 4 deletions spec/jobs/regular/localize_posts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SiteSetting.public_send("ai_translation_model=", "custom:#{fake_llm.id}")
end
SiteSetting.ai_translation_enabled = true
SiteSetting.experimental_content_localization_supported_locales = locales.join("|")
SiteSetting.content_localization_supported_locales = locales.join("|")
end

it "does nothing when translator is disabled" do
Expand All @@ -30,7 +30,7 @@
end

it "does nothing when no target languages are configured" do
SiteSetting.experimental_content_localization_supported_locales = ""
SiteSetting.content_localization_supported_locales = ""
DiscourseAi::Translation::PostLocalizer.expects(:localize).never

job.execute({})
Expand Down Expand Up @@ -136,7 +136,7 @@
fab!(:group_pm_topic) { Fabricate(:group_private_message_topic, recipient_group: group) }
fab!(:group_pm_post) { Fabricate(:post, topic: group_pm_topic, locale: "es") }

before { SiteSetting.experimental_content_localization_supported_locales = "ja" }
before { SiteSetting.content_localization_supported_locales = "ja" }

context "when ai_translation_backfill_limit_to_public_content is true" do
before { SiteSetting.ai_translation_backfill_limit_to_public_content = true }
Expand Down Expand Up @@ -187,7 +187,7 @@

before do
SiteSetting.ai_translation_backfill_max_age_days = 5
SiteSetting.experimental_content_localization_supported_locales = "ja"
SiteSetting.content_localization_supported_locales = "ja"
end

it "only processes posts within the age limit" do
Expand Down
6 changes: 3 additions & 3 deletions spec/jobs/regular/localize_topics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SiteSetting.public_send("ai_translation_model=", "custom:#{fake_llm.id}")
end
SiteSetting.ai_translation_enabled = true
SiteSetting.experimental_content_localization_supported_locales = locales.join("|")
SiteSetting.content_localization_supported_locales = locales.join("|")
end

it "does nothing when translator is disabled" do
Expand All @@ -30,7 +30,7 @@
end

it "does nothing when no target languages are configured" do
SiteSetting.experimental_content_localization_supported_locales = ""
SiteSetting.content_localization_supported_locales = ""
DiscourseAi::Translation::TopicLocalizer.expects(:localize).never

job.execute({})
Expand Down Expand Up @@ -139,7 +139,7 @@
Fabricate(:group_private_message_topic, recipient_group: Fabricate(:group), locale: "es")
end

before { SiteSetting.experimental_content_localization_supported_locales = "ja" }
before { SiteSetting.content_localization_supported_locales = "ja" }

context "when ai_translation_backfill_limit_to_public_content is true" do
before { SiteSetting.ai_translation_backfill_limit_to_public_content = true }
Expand Down
4 changes: 2 additions & 2 deletions spec/jobs/scheduled/post_localization_backfill_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe Jobs::PostLocalizationBackfill do
before do
SiteSetting.ai_translation_backfill_rate = 100
SiteSetting.experimental_content_localization_supported_locales = "en"
SiteSetting.content_localization_supported_locales = "en"
Fabricate(:fake_model).tap do |fake_llm|
SiteSetting.public_send("ai_translation_model=", "custom:#{fake_llm.id}")
end
Expand All @@ -29,7 +29,7 @@
it "does not enqueue psot translation if backfill languages are not set" do
SiteSetting.discourse_ai_enabled = true
SiteSetting.ai_translation_enabled = true
SiteSetting.experimental_content_localization_supported_locales = ""
SiteSetting.content_localization_supported_locales = ""

described_class.new.execute({})

Expand Down
Loading