DEV Community

Francis Okocha-Ojeah
Francis Okocha-Ojeah

Posted on

I built a CLI to catch i18n bugs. It found 74 issues in my own app before they shipped

We ship a React Native app in English and Portuguese. Every other release, someone would find a hardcoded English string or a missing translation key. Manual audits were slow, inconsistent, and honestly, error-prone.

I was tired of it.

So I built locale-lint. A zero‑config CLI that scans your entire codebase and catches the stuff we usually miss.

I ran it on our production app. In less than half a second, it found 74 issues that I had completely overlooked. Keys that existed in English but not Portuguese. Labels that were still raw English. Stuff that would have shipped in the next release.

Here’s exactly what it flagged in our app:

locale-lint terminal output

What it detects

  • Missing keys — e.g. English key missing from Portuguese
  • Unused keys — can be safely cleaned up
  • Undefined keys — called in code but missing from all locale files
  • Hardcoded text — raw strings in JSX like <Text>Welcome</Text>
  • Interpolation mismatches — e.g. {{name}} in EN but {nome} in PT

Why I’m sharing this

If you’re building a React, Next.js, or React Native app with any of these libraries, this works out of the box:

  • i18next / react-i18next
  • next-intl
  • i18n-js
  • react-intl / FormatJS
  • vue-i18n

No config needed. Just run:

npx locale-lint check
Enter fullscreen mode Exit fullscreen mode

It auto‑detects your locale files and source folders. Under 500ms even on a decently sized app. Exits with code 1 if issues are found, so you can throw it straight into CI.

It’s open source (MIT).

Hopefully it saves someone else the same headache.

Top comments (0)