Claude Opus 5.5 · 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 Haiku 5.5.

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

Published comments (2)

mediumbugconfig/initializers/i18n.rb:13-18

Translation cache ignores per-site default locale used in fallback chain — In multisite, the process-global LRU cache in `I18n.translate` (see translate_accelerator.rb) keys only on key, `config.locale` and backend id, so one site's fallback string leaks to other sites and goes stale when `default_locale` changes. Add `SiteSetting.default_locale` or the fallback chain to the cache key, or flush the cache on change.

mediumbuglib/freedom_patches/translate_accelerator.rb:62-68

translate loads only the current locale, not its fallback locales — Outside a request (jobs/base.rb, `PostAlerter`, `PostDestroyer`), only `ApplicationController#set_locale` would load fallbacks, so missing keys return 'translation missing' instead of falling back. Load the full `I18n.fallbacks[config.locale]` chain in `translate` via `ensure_loaded!`.

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 (0)

None.