DeepSeek V4 Pro · 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
1 of 3
Comments published
2
Comments matching a bug
1
Comments not matching
1
Cost of this PR
$1.328

Published comments (2)

highbugapp/controllers/application_controller.rb:159

I18n fallback wiring missing outside ApplicationController#set_locale — Non-HTTP contexts never trigger fallback loading, so Sidekiq jobs risk missing translations or a `NoMethodError` from `@loaded_locales` on first `I18n.t`. Wire the ensure-loaded fallback setup into the job runner and other non-controller entry points, not just `ApplicationController#set_locale`.

mediumbugconfig/initializers/i18n.rb:12-18

FallbackLocaleList#[] never stores computed fallbacks in Hash — Because the computed list is discarded, `I18n.fallbacks` stays permanently empty for every Hash API, so enumeration or inspection silently returns nothing. Store the computed fallbacks in the hash so `each`, `keys`, `key?`, `size`, and `to_a` see the configured mapping.

Gold bugs found (1)

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.

Gold bugs missed (2)

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.
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.