• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 35716386876 / 6
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: mutual_exclusive
DEFAULT BRANCH: master
Ran 22 Sep 2026 10:33AM UTC
Files 171
Run time 9s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Sep 2026 10:30AM UTC coverage: 97.847% (-0.02%) from 97.867%
35716386876.6

Pull #2980

github

ericproulx
Resolve error messages through a translator

Grape::Util::Translation called I18n directly, so every error message was
an I18n lookup and nothing else was possible. It now hands the lookup to
Grape.translator, and ships two that answer it.

Grape::Translator::I18n is the default and is today's code moved, not
changed: it resolves at request time, so the locale in force and an
application's own overrides both apply.

Grape::Translator::Catalog answers from one frozen table instead, built
once from Grape's own locale/en.yml -- read with YAML, so it needs no
I18n -- with whatever I18n has loaded merged over it, so overrides and
other locales are carried. Keys are flat and the interpolation
placeholders are rewritten into the form format takes, so a lookup is a
Hash read and a format. A 400 validation-error response measures 32.2 us
against 53.4 us, 1.66x faster.

What the catalog trades away is in the README: it is a snapshot, so a
locale loaded after it was built is not in it; the locale in force comes
from Grape.locale, which is fiber-local, rather than from I18n; and it
carries the scopes it was asked for, grape by default.

The two are held to each other by a spec that compares every message
Grape ships, with a value supplied for each placeholder, so the one
cannot drift from the other.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2980: Resolve error messages through a translator

1465 of 1546 branches covered (94.76%)

Branch coverage included in aggregate %.

4352 of 4399 relevant lines covered (98.93%)

1184.44 hits per line

Source Files on job run-4.0-gemfiles/rails_8_0.gemfile - 35716386876.6
  • Tree
  • List 171
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 35716386876
  • 6e73b858 on github
  • Prev Job for on translator-seam (#35537785984.31)
  • Next Job for on translator-seam (#35716732143.27)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc