Amazon Ergo 1.0 · 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
$1.912

Published comments (2)

mediumbugapp/controllers/application_controller.rb:159

Fallback locales are only preloaded for web requests — Background jobs and mailers can silently receive missing fallback translations because `I18n.translate` only loads `config.locale`. Preload fallbacks with `I18n.fallbacks.ensure_loaded!` in the translation or locale-setting path, not only in `set_locale`.

mediumbugconfig/initializers/i18n.rb:17

Default-locale changes leave stale fallback translation cache entries — After `SiteSetting.default_locale` changes, users with an explicit locale can keep receiving cached fallback translations—or missing results—from the old locale. Include the fallback locale in the cache key in `lib/freedom_patches/translate_accelerator.rb`, or invalidate the translation cache when `default_locale` 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.