mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 10:50:26 -06:00
PERF: Only invalidate other translations when en changes (#24443)
en is the only fallback locale we use, so there's no need to invalidate everything when other languages change. Limiting this also helps to prevent circular dependent_field relations which could cause issues in some situations.
Followup to eda79186ee
This commit is contained in:
parent
8c16482932
commit
04a58a6e64
@ -664,8 +664,8 @@ class ThemeField < ActiveRecord::Base
|
||||
name: ThemeField.scss_fields + ThemeField.html_fields,
|
||||
)
|
||||
)
|
||||
elsif translation_field?
|
||||
return theme.theme_fields.where(target_id: Theme.targets[:translations])
|
||||
elsif translation_field? && name == "en" # en is fallback for all other locales
|
||||
return theme.theme_fields.where(target_id: Theme.targets[:translations]).where.not(name: "en")
|
||||
end
|
||||
ThemeField.none
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user