GLM-5.3 Flash · Balanced

feature-localization-fallbacks-server-side-discourse-cursor

Discourse · Ruby · S · 30–99 lines · 6 files

The normal review, with one generalist agent. Judge: Claude Opus 5.5.

Gold bugs found
1 of 3
Comments published
1
Comments matching a bug
1
Comments not matching
0
Cost of this PR
$0.063

Published comments (1)

mediumbugconfig/initializers/i18n.rb:12-22

Translate cache not invalidated when site default_locale changes at runtime — The LRU in `translate_accelerator.rb` caches resolved translations without the site `default_locale` in its key, so users keep getting fallbacks resolved against the old locale after an admin changes it. Include the site default locale in the cache key or clear the translate cache when `default_locale` changes.

Gold bugs found (1)

mediumThe translation cache key does not include the site or its default locale, but fallback results now depend on SiteSetting.default_locale, so multisite processes or a changed default locale serve stale fallback translations.

Gold bugs missed (2)

mediumFallback locale catalogs are only loaded in the controller's set_locale filter, while translate loads just the current locale, so translations outside requests (jobs, mailers) cannot fall back to the site default or English.
highFallbackLocaleList#[] reads SiteSetting.default_locale.to_sym on every I18n.t call; when site settings are unavailable (fresh DB/migrations, failed refresh! leaving an empty container) the read returns nil or raises, so I18n.t calls in boot/rake/seed paths crash instead of falling back to :en.