discourse/plugins/discourse-ai/spec/lib/translation/translation_spec.rb
Natalie Tay 5b6d32804a
FIX: Also automatically translate to site's default locale (#37292)
The language switcher automatically includes the site's default locale.

However, when doing automatic translations, we do not add the site's
default locale into the list of languages to translate to.

This commit adds the site's default locale and makes sure content gets
translated to it by default, without the need to add it to `SiteSetting.
content_localization_supported_locales`. This commit also updates the
setting description to indicate as such.
2026-01-24 00:08:34 +08:00

18 lines
513 B
Ruby
Vendored

# frozen_string_literal: true
describe DiscourseAi::Translation do
before do
assign_fake_provider_to(:ai_default_llm_model)
enable_current_plugin
SiteSetting.ai_translation_enabled = true
end
describe ".locales" do
it "delegates to SiteSetting.content_localization_locales" do
SiteSetting.content_localization_supported_locales = "es|fr"
SiteSetting.default_locale = "en"
expect(described_class.locales).to eq(SiteSetting.content_localization_locales)
end
end
end