DeepSeek V4.1 Flash · 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
- 3
- Comments matching a bug
- 2
- Comments not matching
- 1
- Cost of this PR
- $0.118
Published comments (3)
`SiteSetting.default_locale.to_sym` raises NoMethodError when default_locale is nil — A nil `default_locale` raises `NoMethodError` inside `I18n.fallbacks[]` during translation lookups, since `compact` runs after `to_sym`. Build the array first and guard before calling `to_sym`.
Translation cache is not invalidated when default_locale changes — Users keep seeing text from the previous site locale after an admin changes `default_locale`, since the `translate_accelerator.rb` LRU key omits the resolved fallback chain. Include the current `SiteSetting.default_locale` in the cache key or clear `@cache` when it changes.
Fallback chain loaded only on controller path, not in jobs or rake tasks — In Sidekiq threads and rake tasks the `SiteSetting.default_locale`/`:en` fallbacks are looked up against locale files that were never loaded, so missing keys render "translation missing" instead of fallback text. Call `I18n.fallbacks.ensure_loaded!` wherever the locale is changed for a context.
Gold bugs found (2)
Gold bugs missed (0)
None.