Skip to content
CAI
Software that uses CAICheck a score

ruby-i18n/i18n

61.0

Adequate · 6 November 2026

3.3k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 61 → 61 (-0.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 63 → 63 (+0.0)
  • Architecture 93 → 93 (+0.0)
  • Maturity 49 → 48 (-0.5)
  • Readiness 71 → 71 (+0.0)
  • Security 95 → 95 (+0.0)

Resolved (3)

  • Inconsistent naming and parameter ordering for translation operations. The public API Base.translate uses a positional argument style with throw/raise flags, while backend implementations use locale as the first argument. Furthermore, InterpolationCompiler uses interpolate for what appears to be the same core function (replacing placeholders in strings), and Transliterator uses transliterate for character conversion, which is distinct but often confused. The most critical inconsistency is between Base.translate (public entry) and Backend.Base.translate (internal implementation) having different signatures (key-first vs locale-first) and different argument semantics (throw/raise flags vs options hash).
  • Inconsistent parameter ordering for exists?. The public Base.exists? method has _locale as the second argument and locale as the third, which is confusing and likely a typo or legacy artifact. Backend implementations consistently place locale as the first argument. This creates a mismatch between the public API and internal implementations.
  • Off-boarding risk: anonymized user #1

New (2)

  • Off-boarding risk: anonymized user #1
  • Orphaned file (lib/i18n.rb)

Changes since last survey

  • 2 commits — 2 feature/other, 0 fixes

By area

  • (repo) — 1 commit
  • .github/workflows — 1 commit

Notable commits

  • change: Merge pull request #761 from czj/ci-old-rubies-on-ubuntu-24.04
  • change: Run Ruby 3.1 on ubuntu-24.04 now that ubuntu-latest is 26.04

Written by cca.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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a0a416e570fd4998993bde1b5533d0a038bebaf7 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.