# FIX: I18n regression due to recent ruby-i18n update

**URL:** https://meta.discourse.org/t/fix-i18n-regression-due-to-recent-ruby-i18n-update/411859
**Category:** Bug
**Created:** [September 8, 2026, 5:21am UTC](https://meta.discourse.org/t/fix-i18n-regression-due-to-recent-ruby-i18n-update/411859 "2026-09-08T05:21:58Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![small-lovely-cat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/small-lovely-cat/32/553546_2.png) [@small-lovely-cat](https://meta.discourse.org/u/small-lovely-cat)
#### Post date: [September 8, 2026, 5:21am UTC](https://meta.discourse.org/t/fix-i18n-regression-due-to-recent-ruby-i18n-update/411859/1 "2026-09-08T05:21:58Z")

</div>

In [DEPS: Bump i18n from 1.14.8 to 1.15.2 - Pull Request #41242 - discourse/discourse - GitHub](https://github.com/discourse/discourse/pull/41242), we  
updated the ruby-i18n to 1.15.x, however, this version has a defection.

> **Upstream Update Analysis**
>
> First, configuration is now stored on the Fiber:
> 
> ```plaintext
> Fiber[:i18n_config]
> 
> ```
> 
> The new implementation detects when a Fiber inherited a configuration owned by another Fiber:
> 
> ```plaintext
> if current.respond_to?(:owned_by?) && !current.owned_by?(Fiber.current)
> current = current.dup
> Fiber[:i18n_config] = current
> end
> 
> ```
> 
> The problem is in `I18n::Config#initialize_copy`:
> 
> ```plaintext
> def initialize_copy(other)
> @owner = Fiber.current
> end
> 
> ```
> 
> It changes the owner of the copied configuration, but it does not clear the copied `@locale`, i.e., Child Fiber inherits parent’s explicit `@locale`.
> 
> So if the parent Fiber currently has:
> 
> ```plaintext
> I18n.locale == :zh_CN
> 
> ```
> 
> a child Fiber can inherit a copied configuration that still contains:
> 
> ```plaintext
> @locale == :zh_CN
> 
> ```
> 
> even though that child Fiber now represents a different request that should resolve to English.

This cause a problem in discourse. When the user is using a display language different from the default language. Say, Chinese as the site default language and English as the display language, pages may accidentally display in Chinese, or a combination of English and Chinese.

Raise a commit to rollback the version update and added some spec, maybe pausing the update until upstream fix that will be a great idea.

> <https://github.com/discourse/discourse/pull/43363>
>
> In #41242, we
> updated the ruby-i18n to 1.15.x, however, this upstream version h…as a defection.
> 
> \---
> 
> The configuration is now stored on the Fiber:
> 
> \`\`\`ruby
> Fiber\[:i18n\_config\]
> \`\`\`
> 
> The new implementation detects when a Fiber inherited a configuration owned by another Fiber:
> 
> \`\`\`ruby
> if current.respond\_to?(:owned\_by?) && !current.owned\_by?(Fiber.current)
> current = current.dup
> Fiber\[:i18n\_config\] = current
> end
> \`\`\`
> 
> The problem is in \`I18n::Config#initialize\_copy\`:
> 
> \`\`\`ruby
> def initialize\_copy(other)
> @owner = Fiber.current
> end
> \`\`\`
> 
> It changes the owner of the copied configuration, but it does not clear the copied \`@locale\`, i.e., Child Fiber inherits parent's explicit \`@locale\`.
> 
> So if the parent Fiber currently has:
> 
> \`\`\`ruby
> I18n.locale == :zh\_CN
> \`\`\`
> 
> a child Fiber can inherit a copied configuration that still contains:
> 
> \`\`\`ruby
> @locale == :zh\_CN
> \`\`\`
> 
> even though that child Fiber now represents a different request that should resolve to English.
> 
> \---
> 
> This cause a problem in discourse. When the user is using a display language different from the default language. Say, Chinese as the site default language and English as the display language, pages may accidentally display in Chinese, or a combination of English and Chinese.
> 
> This commit rollback the version update and added some spec, maybe pausing the update until upstream fix that will be a great idea.
> 
> Related issue: https://github.com/ruby-i18n/i18n/issues/742

---

_[View the full topic](https://meta.discourse.org/t/fix-i18n-regression-due-to-recent-ruby-i18n-update/411859)._
