Skip to content
CAI
Software that uses CAICheck a score

glebm/i18n-tasks

64.2

Adequate · 6 November 2026

8.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 JSON locale data adapter and refactor YAML adapter

The library now supports JSON as a format for locale data files via a new JsonAdapter, allowing users to read and write locale data in JSON format alongside the existing YAML support. The existing YamlAdapter has been refactored to include specific logic for restoring emojis that may be escaped during YAML dumping and stripping trailing spaces added by older libyaml versions, ensuring data integrity across different Ruby and YAML library versions.

lib/i18n/tasks/data/adapter · high confidence

Add executable entry points for i18n-tasks on Unix and Windows

The repository now includes the \bin/i18n-tasks\ script for Unix-like systems and \bin/i18n-tasks.cmd\ for Windows, allowing users to run the tool directly from the command line. The Unix script initializes the I18n gem with \enforce\_available\_locales\ set to true by default to prevent warnings and then starts the CLI, while the Windows batch file delegates to the same Ruby script.

bin · high confidence

Add performance benchmark suite for i18n-tasks

A new benchmark suite has been added to the \benchmarks/\ directory to measure and track performance across the i18n-tasks library. The suite includes scripts for scanning (\scanning\_bench.rb\), tree operations (\tree\_bench.rb\), data I/O (\data\_bench.rb\), and end-to-end pipelines (\end\_to\_end\_bench.rb\), along with a helper (\bench\_helper.rb\) and a fixture generator (\fixtures/generator.rb\) that creates synthetic data at small, medium, and large scales. Results can be saved as baselines or compared against previous runs to detect regressions, with optional memory profiling support.

benchmarks · high confidence

Conservative router preserves original key paths or infers from base locale

The i18n-tasks library now includes a new ConservativeRouter that improves how translation keys are routed to file paths. Instead of relying solely on pattern-based inference, this router attempts to preserve the original path data associated with a key. If the original path is unavailable for a specific locale, it infers the path from another locale (such as the base locale) by replacing the locale segment. For any keys where the path cannot be determined or inferred, it falls back to the standard PatternRouter behavior, ensuring that existing translations maintain their file structure while new or missing keys are handled gracefully.

i18n-tasks · high confidence

Initial release of i18n-tasks v0.0.1

This commit introduces the initial version of the i18n-tasks gem, providing a comprehensive toolkit for managing i18n translation files. It includes a CLI for running tasks such as checking for missing, unused, or inconsistent keys, and supports multiple translation backends including Google, DeepL, OpenAI, Yandex, and Watsonx. The core functionality relies on a modular architecture with separate modules for handling key patterns, pluralization, references, and data storage, along with scanners for Ruby and ERB files to detect usage.

lib/i18n/tasks · high confidence

New AST-based and pattern-matching scanner architecture

The scanner subsystem has been refactored into a modular architecture with a new \Scanner\ base class and a \ScannerMultiplexer\ to combine results from multiple scanners. A new \FileScanner\ base class handles file traversal and caching, serving as the foundation for the existing \PatternScanner\ (regex-based) and the new \PatternMapper\ (configurable regex patterns). Additionally, a new \RubyScanner\ introduces AST-based parsing for Ruby files using the \parser\ gem and optionally \Prism\, while a new \ErbAstScanner\ extends this to ERB templates by extracting and parsing embedded Ruby code. Supporting modules like \RelativeKeys\, \OccurrenceFromPosition\, and \RubyKeyLiterals\ have been extracted to share logic across scanners.

lib/i18n/tasks/scanners · high confidence

New CLI commands for translation data management and parser comparison

This release introduces several new commands to the i18n-tasks CLI. The \check\_prism\ command allows users to compare keys discovered by the default parser against those found by the Prism parser, generating a detailed report of discrepancies. Data manipulation is enhanced with \normalize\ and \check\_normalized\ for key path consistency, and new tree operations \mv\, \cp\, and \rm\ enable pattern-based moving, copying, and removal of translation keys. Additionally, the \prune\ command now supports a \--keep-order\ flag to preserve key ordering during deletion, and the \missing\ command includes a \--types\ option to filter missing key reports by specific categories.

lib/i18n/tasks/command/commands · high confidence

New extensible plugin API for scanners, commands, and AST matchers

The \lib/i18n/tasks.rb\ entry point now exposes methods to extend the tool's capabilities: \add\_scanner\ registers custom file scanners, \add\_commands\ integrates new CLI commands, and \add\_ast\_matcher\ allows users to define custom AST matching logic. This change shifts the library from a fixed set of internal behaviors to an extensible architecture, allowing users to customize how translation keys are searched, processed, and reported without modifying the core library code.

lib/i18n · high confidence

New pattern-based router for locale file routing

Introduces a new PatternRouter that allows users to define custom routing rules for i18n keys to specific locale files using pattern matching. Users can configure write routes via a list of patterns and destination paths (e.g., mapping 'devise.\*' keys to 'config/locales/devise.%{locale}.yml'), with support for backreferences in destination paths and a default catch-all route. This provides more granular control over how translation keys are distributed across locale files compared to the previous default behavior.

lib/i18n/tasks/data/router · high confidence

New translator backends and base infrastructure for i18n translations

The \lib/i18n/tasks/translators\ directory now includes a \BaseTranslator\ class that standardizes translation logic (batching, progress bars, interpolation handling) and introduces four new translator implementations: \OpenAiTranslator\ (using \gpt-4o-mini\ with configurable prompts and JSON output), \WatsonxTranslator\ (using IBM Watsonx with a default Llama model), \YandexTranslator\ (using the \yandex-translator\ gem), and a custom \GoogleTranslator\ (implementing the Google Cloud Translate v2 API directly with newline preservation). These additions expand the available translation services beyond the previous DeepL-only or external-gem-dependent options.

lib/i18n/tasks/translators · high confidence

Architecture

Refactored CLI command structure with new DSL and Commander

The internal structure for CLI commands has been reorganized into a new modular design. A new \Commander\ class now handles task execution and logging, including a specific message logged to stderr. Command definitions are managed via a new \DSL\ module that allows declarative specification of commands and arguments, and a \Collection\ module provides a convenient way to include these DSL and option modules into command classes. This change simplifies how new CLI tasks are defined and integrated within the library.

lib/i18n/tasks/command · high confidence

Behavioural changes

15 commits (1 fix) modifying lib/i18n/tasks/scanners/files

A change to existing behaviour in lib/i18n/tasks/scanners/files — 15 commits (1 fix), 6 files: “Speed up \missing\ and \unused\ by \~9% on large apps by matching extension globs by their suffix (\#782)”; “Switch to StandardRB configuration for Rubocop (\#646)”; “Fix concurrency issues with file caches”; and 12 more (refs \#782, \#646, \#775, \#786).

lib/i18n/tasks/scanners/files · medium confidence · unverified

New CLI option parsers for enum and locale arguments

The CLI now includes dedicated option parsers for enum and locale arguments, improving validation and error handling. The new \Enum::Parser\ and \Enum::ListParser\ validate command inputs against allowed values, providing clear error messages when invalid options are provided. The \Locale::Parser\ and \Locale::ListParser\ validate locale strings against a standard format, handle special cases like 'base' and 'all', and ensure the base locale appears first in lists. These changes enhance the robustness of CLI commands that accept enum or locale parameters.

_lib/i18n/tasks/command/option\parsers · high confidence

New terminal-based report output for i18n tasks

The \lib/i18n/tasks/reports\ directory now contains a new \Base\ class and a \Terminal\ reporter that generate structured, colorized table output for i18n analysis tasks. Users will see improved terminal reports for missing keys, inconsistent interpolations, reserved interpolations, used keys, unused keys, and keys equal to the base locale, featuring formatted locale headers, key/value tables, and usage counts. This replaces previous ad-hoc or less structured reporting mechanisms with a consistent, table-based view for all major i18n diagnostic tasks.

lib/i18n/tasks/reports · high confidence

Refactored CLI option definitions into modular files

The command-line interface options have been reorganized from a single monolithic structure into three distinct modules: \Common\ (handling global flags like \--config\ and \--nostdin\), \Data\ (managing data/output formats such as \yaml\, \json\, and the new \key-values\ format), and \Locales\ (handling locale filters and the \--backend\ flag for translation services). This change improves the maintainability of the CLI DSL by separating concerns, allowing users to benefit from the expanded format options and clearer option grouping without altering the external command syntax.

lib/i18n/tasks/command/options · high confidence

Refactors i18n scanner results into dedicated KeyOccurrences and Occurrence classes

The scanner's result handling has been restructured to use explicit value objects: \KeyOccurrences\ now represents a scanned key along with all its occurrences, including a new \merge\_keys\ method to consolidate multiple instances of the same key while preserving order and uniqueness. The \Occurrence\ class has been expanded to track additional context such as \raw\_key\, \default\_arg\, and \candidate\_keys\, and its \inspect\ format has been updated to include these details, providing richer information for debugging and analysis of translation key usage.

lib/i18n/tasks/scanners/results · high confidence

Refactors i18n scanner to use extensible AST matchers

The i18n scanner's internal architecture has been refactored to use a class-based AST matcher system, introducing a \BaseMatcher\ and specific matchers for \default\_i18n\_subject\, \message\_receivers\, and \rails\_model\. This change improves the scanner's ability to detect translation keys, including handling slash notation in ActiveRecord attribute translations and supporting \default\_i18n\_subject\ calls, while providing a more modular foundation for future matcher additions.

_lib/i18n/tasks/scanners/ast\matchers · high confidence

Replace nested hashes with a dedicated i18n data tree structure

The internal representation of i18n translation data has been refactored from nested Ruby hashes to a dedicated tree structure (Node, Siblings, Nodes). This change introduces explicit tree nodes with parent/child relationships, enabling more robust operations such as key renaming with reference updates, granular traversal (depth-first, breadth-first), and improved handling of merge conflicts and missing keys. Users benefit from more accurate reporting of unused or missing keys and better support for complex tree manipulations like moving or renaming keys while preserving symbolic references.

lib/i18n/tasks/data/tree · high confidence

Rewritten Prism scanner with modular argument and node handling

The Prism-based i18n scanner has been refactored to improve how it parses Ruby code and extracts translation keys. The previous monolithic visitor logic has been split into dedicated components: an \ArgumentsVisitor\ now handles the extraction of static values from method arguments (such as keys and scope options), while a new \nodes.rb\ module defines structured classes (\Root\, \TranslationCall\, etc.) to represent the parsed translation context. The main \Visitor\ class now delegates argument processing to the new visitor and uses these node structures to track scopes, receivers, and candidate keys more accurately. This change enhances the scanner's ability to correctly identify translation calls in complex scenarios, such as those involving dynamic arguments or specific Rails model patterns, by providing a more robust and maintainable parsing foundation.

_lib/i18n/tasks/scanners/prism\scanners · high confidence

Support for JSON locale files and improved file handling

The library now supports reading and writing locale data in JSON format in addition to the existing YAML support, allowing users to store translations in \.json\ files. This change also introduces a conservative router as the default for managing key paths, ensures that only changed files are written to disk to reduce unnecessary I/O, and adds warnings when nil keys are encountered in locale data files.

lib/i18n/tasks/data · high confidence

Switch to StandardRB and update development tooling

The project has migrated its Ruby linting configuration from the previous RuboCop setup to the StandardRB gem, inheriting its base configuration. This change is accompanied by the addition of several development configuration files: a new \.rubocop.yml\ and \.rubocop\_todo.yml\ to manage the new style guide and existing offenses, an \.overcommit.yml\ to configure pre-commit hooks, a \.codeclimate.yml\ for code quality ratings, and a \.simplecov\ file for coverage reporting. Additionally, the \.gitignore\ has been expanded to exclude common Ruby build artifacts and temporary files, and a \.git-blame-ignore-revs\ file has been added to ignore the bulk formatting commit.

(repo-wide) · high confidence

Thread-safe caching for concurrent file access

The library now includes a thread-safe caching mechanism in the concurrent module to prevent race conditions when multiple threads access file caches simultaneously. This is implemented via a new \Cache\ class that uses a mutex to ensure atomic lookups and a \CachedValue\ class that guarantees a computation block is invoked at most once, even under concurrent access. This change addresses concurrency issues where values might be computed multiple times or accessed in an inconsistent state.

lib/i18n/tasks/concurrent · high confidence

Test coverage

Added ERB view fixtures for i18n-tasks testing; Added fixture views for comprehensive I18n key scanning tests; Added i18n test template for missing, unused, unnormalized, and inconsistent interpolation checks; Added i18n validation specs; Added test coverage for i18n-tasks command suite; Added test coverage for translation services; Added test fixture for controller I18n key detection; Added test fixture for i18n-tasks configuration; Added test fixtures for I18n key usage and custom scanner matching; Added test fixtures for custom scanner and plugin examples; Added tests for file scanning components; Added tests for locale tree structure and traversal; Added tests for pattern mapper, key literal validation, and scanner multiplexer; Expanded test coverage for i18n-tasks core features and scanners; New test support utilities for i18n-tasks specs.

Dependencies

Update gem dependencies and drop support for Ruby versions older than 3.1

The i18n-tasks gem now requires Ruby 3.1 or newer, dropping support for earlier versions. Several runtime dependencies have been updated or added to support this and improve functionality: 'parser' is now required at version 3.2.2.1 or higher, 'highline' is bumped to 3.0.0 or higher, 'rainbow' is constrained to versions 2.2.2 through 3.x, and 'ast' is required at 2.1.0 or higher. Additionally, 'prism' has been added as a new dependency, while 'erubi' is now explicitly listed as a runtime dependency (replacing the previous 'better\_html' dependency for ERB scanning).

(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 59 → 64 (+5.5)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 67 → 66 (-0.2)
  • Architecture 78 → 76 (-1.7)
  • Maturity 40 → 53 (+12.8)
  • Readiness 78 → 78 (+0.0)
  • Security 95 → 92 (-3.2)
  • Performance 95 → 95 (+0.0)

Resolved (9)

  • Off-boarding risk: anonymized user #1
  • Orphaned file (lib/i18n/tasks/data/file_formats.rb)
  • Orphaned file (lib/i18n/tasks/data/tree/node.rb)
  • Orphaned file (lib/i18n/tasks/data/tree/siblings.rb)
  • Orphaned file (lib/i18n/tasks/scanners/relative_keys.rb)
  • Orphaned file (lib/i18n/tasks/translators/deepl_translator.rb)
  • Orphaned file (lib/i18n/tasks/translators/watsonx_translator.rb)
  • Orphaned file (lib/i18n/tasks/used_keys.rb)
  • Redundant entry points: Both start and run accept identical arguments and likely serve the same purpose of initiating the CLI execution. Having two public methods with identical signatures for the same high-level action creates confusion about which one to use.

New (3)

  • Off-boarding risk: anonymized user #1
  • Traversal.set_each_value! (cognitive 20) (lib/i18n/tasks/data/tree/traversal.rb)
  • Traversal.set_each_value! (cyclomatic 19) (lib/i18n/tasks/data/tree/traversal.rb)

Changes since last survey

  • 20 commits — 19 feature/other, 1 fixes

By area

  • lib/i18n — 11 commits
  • (root) — 7 commits
  • .github/workflows — 1 commit
  • templates/config — 1 commit

Notable commits

  • fix: Fix find crashing on Prism occurrences by storing the whole line and counting characters (#789)
  • change: Attach comments only to files with a magic comment (#792)
  • change: Count line_pos within the line in Prism occurrences (#794)
  • change: Document which file wins when a key is defined in several read files
  • change: Find a node by its full key in one pass (#790)
  • change: Find keys split across adjacent string literals in Ruby files (#798)
  • change: Keep blank keys and keys containing a dot in their file with the conservative router (#796)
  • change: Make unused follow search.strict when no flag is passed (#779)
  • change: Match only and exclude globs under search.paths: ["."] (#786)
  • change: Parse the source once for the strict and non-strict scans of unused (#775)
  • change: Pin CI runners to ubuntu-24.04 so Ruby 3.1 installs again (#787)
  • change: Point to Dir.glob for the order of files within a pattern, and pin the read order with specs
  • change: Preserve arrays, numbers, and booleans in add-missing (#795)
  • change: Preserve completed translation batches after failures (#767)
  • change: Read ERB files as UTF-8 in the Prism scanner (#793)
  • change: Revise CHANGES.md for Prism updates and performance (#778)
  • change: Speed up missing and unused by ~9% on large apps by matching extension globs by their suffix (#782)
  • change: Speed up unused by ~5% by expanding the relative roots once (#783)
  • change: Speed up loading locale data by ~35% by building each node under its parent (#781)
  • change: Write locale files atomically (#780)

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

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

Survey your own repository

glebm/i18n-tasks 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 c8ebe7fec71ed3de4c574d50af1f4331bac88ee5 — 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.2+preprod-5c4e66d9318b.