GLM-5.3 Flash · Heavy

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

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

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Opus 5.5.

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

Published comments (2)

mediumbugapp/controllers/application_controller.rb:159

Fallback locales not loaded when I18n.locale is set outside requests — Emails and background jobs translate with only the switched-to locale loaded, so sites with a non-English `default_locale` fall straight back to English or show 'translation missing' instead of the configured chain. Call `I18n.fallbacks.ensure_loaded!` wherever `I18n.locale` is switched outside the request cycle, e.g. in `Jobs::Base`.

mediumbugconfig/initializers/i18n.rb:12-18

Fallback chain uses runtime SiteSetting.default_locale not reflected in accelerator cache key — Changing `SiteSetting.default_locale` at runtime keeps serving stale fallback translations, since the accelerator's LRU key ignores the site default. Include the fallback base in the cache key or bust the cache when the setting changes.

Gold bugs found (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.
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 (1)

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.