DeepSeek V4.1 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 Haiku 5.5.

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

Published comments (3)

highbuglib/freedom_patches/translate_accelerator.rb:62-65

Fallback chain isn't loaded for non-request translations; misses are cached — Translations outside a request (jobs, mailers, rake tasks) resolve the fallback chain against a locale that `load_locale` never loaded, raising `MissingTranslation`. Load the whole `I18n.fallbacks` chain inside `I18n.translate`/`load_locale` instead of relying on the controller filter.

highbugconfig/initializers/i18n.rb:12-18

I18n fallback lookup raises when SiteSetting is unavailable — `FallbackLocaleList#[]` runs on every `I18n.t` and reads `SiteSetting.default_locale`, which queries the DB and raises in boot/rake paths when it's unavailable. Guard the lookup with a rescue that falls back to `:en`, or resolve the site locale once outside the per-call chain.

mediumbugconfig/initializers/i18n.rb:17

Translation cache key ignores fallback site default locale — Fallback results now depend on `SiteSetting.default_locale`, but the cache key in `translate_accelerator.rb` omits it and nothing calls `I18n.reload!` on settings changes, so stale languages persist after an admin updates `default_locale`. Include the site default locale in the cache key or clear the cache on `site_setting_saved`.

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.