Skip to content

Restore Ruby 3.1 support - #739

Merged
radar merged 1 commit into
ruby-i18n:masterfrom
koic:restore_ruby_3_1_support
Jun 19, 2026
Merged

Restore Ruby 3.1 support#739
radar merged 1 commit into
ruby-i18n:masterfrom
koic:restore_ruby_3_1_support

Conversation

@koic

@koic koic commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

i18n 1.15.1 raised the required Ruby version to 3.2 to address #735, where Ruby 3.1 users hit NoMethodError: undefined method '[]' for Fiber:Class. As a result, Ruby 3.1 users remain on the broken i18n 1.15.0 release and cannot upgrade to a fixed version.

Restore Ruby 3.1 support and ship a patch that works on both Ruby 3.1 and Ruby 3.2 so that Ruby 3.1 users can upgrade to 1.15.x without incompatibility. On Ruby without the Fiber[] storage API (Ruby 3.1), the config and fallbacks storage falls back to thread-local variables; on Ruby 3.2+ it keeps using Fiber storage. The previously removed test branches and Fiber-isolation skip guards are brought back as regression coverage for the Ruby 3.1 path.

This approach also lets existing Ruby 3.1 users who pin gem "i18n", "!= 1.15.0" in their Gemfile use i18n 1.15.2 and later without incompatibility.

The CI matrix gains Ruby 3.1, excluding the Rails 8.0.x (requires Ruby 3.2+) and Rails main (requires Ruby 3.3+) gemfiles which do not support Ruby 3.1.

Although Ruby 3.1 is already EOL, libraries (unlike applications) provide value by remaining usable for a broad range of users, so the thread-local fallback path is intentionally retained for environments without Fiber[] (including JRuby 9.4).

i18n 1.15.1 raised the required Ruby version to 3.2 to address ruby-i18n#735,
where Ruby 3.1 users hit `NoMethodError: undefined method '[]' for Fiber:Class`.
As a result, Ruby 3.1 users remain on the broken i18n 1.15.0 release and cannot
upgrade to a fixed version.

Restore Ruby 3.1 support and ship a patch that works on both Ruby 3.1 and Ruby 3.2
so that Ruby 3.1 users can upgrade to 1.15.x without incompatibility.
On Ruby without the `Fiber[]` storage API (Ruby 3.1), the config and fallbacks
storage falls back to thread-local variables; on Ruby 3.2+ it keeps using Fiber storage.
The previously removed test branches and Fiber-isolation skip guards are
brought back as regression coverage for the Ruby 3.1 path.

This approach also lets existing Ruby 3.1 users who pin `gem "i18n", "!= 1.15.0"`
in their Gemfile use i18n 1.15.2 and later without incompatibility.

The CI matrix gains Ruby 3.1, excluding the Rails 8.0.x (requires Ruby 3.2+) and
Rails main (requires Ruby 3.3+) gemfiles which do not support Ruby 3.1.

Although Ruby 3.1 is already EOL, libraries (unlike applications) provide value
by remaining usable for a broad range of users, so the thread-local fallback path is
intentionally retained for environments without `Fiber[]` (including JRuby 9.4).
@radar

radar commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Thank you @koic!

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.

2 participants