Skip to content

Reload I18n after a test pins the available locales - #12026

Merged
iHiD merged 1 commit into
mainfrom
reload-i18n-after-locale-pin
Oct 29, 2026
Merged

iHiD merged 1 commit into
mainfrom
reload-i18n-after-locale-pin

Conversation

@iHiD

@iHiD iHiD commented Oct 28, 2026

Copy link
Copy Markdown
Member

I18n only stores translations for the locales that are available when it loads. When with_published_translations runs inside with_available_locales(:hu), its reload rebuilds the backend with English and Hungarian only. with_available_locales then restored the locale list without reloading, so every later test in the same process saw no Japanese, Greek or other served locales. This made DateFormatHelperTest fail with Translation missing: ja.date.formats.long whenever it ran after test/commands/exercise/cached_content/retrieve_test.rb.

with_available_locales now calls I18n.reload! after it restores the locales, so every caller leaves the full backend behind.

I couldn't run the tests locally because OpenSearch was not running, so CI will need to cover them.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iHiD
iHiD merged commit 3fc8960 into main Oct 29, 2026
29 checks passed
@iHiD
iHiD deleted the reload-i18n-after-locale-pin branch October 29, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant