mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-19 04:03:45 +08:00
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.
18 lines
513 B
Ruby
Vendored
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
|