mirror of
https://github.com/discourse/discourse.git
synced 2025-06-14 19:29:21 +08: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 eda79186eefaf97fe916d97c256c3e7b807d2237
This commit is contained in:
@ -664,8 +664,8 @@ class ThemeField < ActiveRecord::Base
|
|||||||
name: ThemeField.scss_fields + ThemeField.html_fields,
|
name: ThemeField.scss_fields + ThemeField.html_fields,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elsif translation_field?
|
elsif translation_field? && name == "en" # en is fallback for all other locales
|
||||||
return theme.theme_fields.where(target_id: Theme.targets[:translations])
|
return theme.theme_fields.where(target_id: Theme.targets[:translations]).where.not(name: "en")
|
||||||
end
|
end
|
||||||
ThemeField.none
|
ThemeField.none
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user