Skip to content
CAI
Software that uses CAICheck a score

ruby-i18n/i18n

68.0

Adequate · 20 September 2026

3.3k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is the I18n internationalization library for Ruby, providing a framework for translating, pluralizing, and localizing text. It supports multiple backend storage strategies, including file-based, database-backed, and cached implementations, with features for locale fallbacks and lazy loading. The library also includes tools for parsing Gettext PO files and offers fiber-safe configuration management for modern Ruby environments.

How it got here

2008 — I18n library core development and modernization

6 changes.

This period focused on the initial release and subsequent evolution of the I18n internationalization library for Ruby, establishing core features like translation, pluralization, and backend modules for caching and fallbacks. Significant work was done to modernize the codebase by updating supported Ruby and Rails versions, implementing fiber-safe configuration mechanisms, and adding comprehensive test coverage to ensure stability and performance.

2009 — Locale resolution and backend benchmarking

6 changes.

This period focused on implementing a robust locale fallback and tag resolution system, introducing pluggable parsing strategies and parent hierarchy support. Comprehensive test coverage was added for the new locale logic and Gettext backend integration, alongside a new benchmark suite to evaluate translation backend performance.

2010–2021 — I18n backend and interpolation expansion

9 changes.

This period focused on expanding the I18n library's capabilities by introducing Gettext helpers, a dedicated PO parser, and support for custom interpolation patterns. Significant effort was dedicated to comprehensive test coverage, adding suites for backend configurations, localization methods, and core translation behaviors to ensure robustness across new features.

Features

Add benchmark suite for I18n backends

A new benchmark suite has been added to measure the performance of I18n translation backends. The suite includes a sample locale file (\benchmark/example.yml\) and a runner script (\benchmark/run.rb\) that evaluates Simple, InterpolationCompiler, and KeyValue backends. It measures execution time and object allocation for operations such as storing translations, retrieving available locales, and translating strings at various depths, with support for both standard and memoized performance modes.

benchmark · high confidence

Initial release of the I18n internationalization library

Introduces the core I18n library for Ruby, providing a framework for translating, pluralizing, and interpolating text. The implementation includes a configuration system stored in Fiber or Thread variables, a default Simple backend, and support for reserved keys to prevent interpolation conflicts. It establishes the public API for \I18n.t\ and \I18n.localize\, along with exception handling and locale enforcement mechanisms.

lib · high confidence

New backend modules for caching, chaining, fallbacks, and lazy loading

The i18n library introduces several new backend modules to enhance performance and flexibility. The Cache and CacheFile modules allow translation lookups to be stored in memory or on disk to speed up repeated access. The Chain backend enables combining multiple backends (e.g., file-based and database-backed) into a single lookup chain. The Fallbacks module provides configurable locale fallback logic, allowing the system to use translations from a parent locale when a specific one is missing. Additionally, the LazyLoadable backend defers loading translation files until the specific locale is actually needed, improving startup performance in environments with many locales.

lib/i18n/backend · high confidence

New locale fallback and tag resolution system

The library now includes a new \I18n::Locale::Fallbacks\ class and a \I18n::Locale::Tag\ module to manage locale resolution. The fallback system allows users to define custom mappings between locales (e.g., mapping \ca\ to \es-ES\) and automatically computes fallback chains including parent locales and defaults. The tag module provides a pluggable interface for parsing locale tags, defaulting to a simple implementation (\I18n::Locale::Tag::Simple\) but allowing users to switch to RFC 4646 compliant parsing if needed.

lib/i18n/locale · high confidence

Behavioural changes

I18n library updated to version 1.15.2

The I18n internationalization library has been updated to version 1.15.2. This release includes the addition of a CacheFile backend module for persistent translation caching, a new middleware that resets the current locale's configuration after each request to ensure thread/fiber safety, and an InterpolationCompiler extension that allows clients to use custom interpolation patterns. The configuration object has been moved to a dedicated module, and the library now requires Ruby 3.2+ with simplified Fiber-based config storage.

lib/i18n · high confidence

New Gettext helper methods and localized PO parser

The library now includes \lib/i18n/gettext/helpers.rb\, providing \I18n::Gettext::Helpers\ with classical Gettext-style accessors such as \\\, \N\\, \s\\, \p\\, \n\\, \ns\\, and \np\_\ to facilitate translation extraction and context-aware lookups. Additionally, \lib/i18n/gettext/po\_parser.rb\ introduces a dedicated \GetText::PoParser\ class for parsing \.po\ files, ensuring that fuzzy state is kept instance-local during parsing.

lib/i18n/gettext · high confidence

New locale tag parsing implementations with parent hierarchy support

The library now includes three distinct locale tag parsing strategies: a strict RFC 4646/47 compliant parser, a simple split-based parser, and a shared module for computing parent locale hierarchies. The new \Parents\ module provides \parent\, \parents\, and \self\_and\_parents\ methods to traverse locale inheritance, while \Rfc4646\ and \Simple\ classes offer different levels of parsing rigor for locale tags, allowing the system to handle locale resolution with varying degrees of strictness.

lib/i18n/locale/tag · high confidence

Refactored I18n interpolation engine with custom pattern support

The I18n string interpolation logic has been rewritten to support custom interpolation patterns via a new \interpolation\_patterns\ configuration, allowing clients to define their own placeholder syntaxes (such as pipe-separated variants like \%{foo\|word}\). The implementation now caches compiled regular expressions for performance and ensures that strings with no interpolations are returned as the same object to avoid unnecessary allocations. Additionally, missing interpolation argument errors now include the translation key for easier debugging, and the system properly handles \ActiveSupport::SafeBuffer\ inputs.

lib/i18n/interpolate · high confidence

Update supported Ruby and Rails versions and add fiber-safe config updates

The library now officially supports Ruby 3.1+ and Rails 6.0+, dropping support for older versions. A new fiber-safe configuration mechanism has been added, allowing users to create immutable config updates using \I18n.config.with(locale: :ja).set!\ to avoid sharing mutable config objects across fibers. The README has been updated to reflect these version requirements and usage instructions.

(repo-wide) · high confidence

Test coverage

Add comprehensive test suite for I18n core functionality; Added API tests for I18n backend configurations; Added comprehensive test suite for I18n backend modules; Added localization tests for Date, DateTime, Time, and Proc formats; Added test coverage for I18n exceptions, interpolation, load paths, and middleware; Added test coverage for RFC4646 and Simple locale tag implementations; Added test fixtures for locale pluralization rules and translation formats; Added tests for Gettext API and backend integration; Added tests for I18n locale fallbacks behavior; Standardized i18n test suite for core translation behaviors.

Dependencies

Expanded test matrix for Rails 7.0–8.0 and Ruby 3.4

The gemfiles in the \gemfiles/\ directory have been updated to support testing against Rails versions 7.0.x, 7.1.x, 7.2.x, 8.0.x, and the Rails \main\ branch. This includes adding specific \activesupport\ version constraints for each target, updating the \mocha\ gem to version 2.x, and ensuring compatibility with Ruby 3.4 by explicitly including the \racc\ gem (which was extracted in Ruby 3.3).

gemfiles · high confidence

Update development dependencies and Ruby version requirement

The project now requires Ruby 3.1 or later and updates its development dependencies to use mocha \~\> 2.1.0, rake \~\> 13, minitest \~\> 5.14, and test\_declarative 0.0.6, while also adding explicit dependencies on json and racc.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 68.

Lenses

  • Code Health 96
  • Architecture 97
  • Maturity 51
  • Readiness 70
  • Security 96

Changes since last survey

  • 300 commits — 257 feature/other, 43 fixes

By area

  • lib/i18n — 105 commits
  • (repo) — 103 commits
  • .github/workflows — 38 commits
  • (root) — 16 commits
  • lib/i18n.rb — 12 commits
  • test/backend — 12 commits
  • gemfiles/Gemfile.rails-6.1.x — 3 commits
  • test/i18n_test.rb — 3 commits
  • test/i18n — 2 commits
  • test/test_helper.rb — 2 commits
  • .github/funding.yml — 1 commit
  • gemfiles/Gemfile.rails-5.0.x — 1 commit
  • gemfiles/Gemfile.rails-6.0.x — 1 commit
  • test/test_data — 1 commit

Notable commits

  • fix: Bump Mocha deps to v2 to fix build issue
  • fix: CI: Fix rails version specification in gemfiles to run with the specified minor version
  • fix: Fix ArgumentError when Fallbacks#map used as in Hash
  • fix: Fix I18n.t when locale contains separator
  • fix: Fix a build error when using Psych 4.0
  • fix: Fix build warnings in the CI by using actions/checkout@v3
  • fix: Fix compatibility with --enable-frozen-string-literal
  • fix: Fix example doc
  • fix: Fix load_path example in README.md
  • fix: Fix loading of .rb locale files when load_path is not a string, eg it is a Pathname
  • fix: Fix missing requires of i18n/core_ext/hash
  • fix: Fix rubocop issues
  • fix: Fix string locale will trigger on_fallback hook.
  • fix: Fix symbol resolving with pluralization
  • fix: Fix syntax in documentation for I18n::Backend::Base.interpolate
  • fix: Fix that escaped interpolations for reserved keywords raised an error
  • fix: Fixes strings being interpolated multiple times
  • fix: Merge pull request #570 from bagilevi/fix-argument-error-in-fallbacks
  • fix: Merge pull request #572 from codealchemy/simple_backend/json-test-fix
  • fix: Merge pull request #585 from patrickgramatowski/Fix-typo-function-is-missing-closing-parenthesis
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

ruby-i18n/i18n was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 547917dd8d41fab781a81880f22687fc4eac5d85 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.