Skip to content

Recognise en-US and other English variants as the source in check - #116

Merged
arvida merged 2 commits into
mainfrom
fix/827-en-variant-source
Oct 4, 2026
Merged

arvida merged 2 commits into
mainfrom
fix/827-en-variant-source

Conversation

@arvida

@arvida arvida commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Fixes localheroai/localhero-ai#827.

Without a localhero.json, check treated only a plain en as English. A project whose English file is en-US.json (the most common JavaScript naming) fell through to "the language with the most keys", so every locale was compared with, say, Arabic. In a 40-repo run over popular open-source apps this hit 9 repos, e.g. formbricks → ar-EG, umami → az-AZ, mealie → af-ZA, lobe-chat → zh-CN.

Now: a plain en first as before, else en-US/en_US (any case), else the first other en-*/en_* variant. The gettext and .pot rules keep their precedence. The info line reads "English is present" instead of "en is present".

Verified

  • Tests first; full suite passes, lint and build clean.
  • Built CLI on formbricks, umami, mealie and lobe-chat: source is now en-US and files pair correctly (real key counts, no "Not checked"); open-webui, cal.com, saleor-dashboard and lago-front pick en.
  • Reviewed (code-reviewer agent; a Codex run timed out): no blockers. It confirmed file pairing escapes the locale and matches it as a whole token, so an en-US source pairs en-US.json with de.json and locales/en-US/ with locales/de/.

arvida added 2 commits October 3, 2026 23:18
- Without a localhero.json, only a plain en counted as English; en-US.json projects got the language with the most keys as source
- US English wins among several English variants; a plain en still comes first
- The info line now says "English is present"
@arvida
arvida merged commit bc2dc13 into main Oct 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant