---
source: https://cli.eloqnt.dev/docs/lint-rules/invalid-locale
docs_index: https://cli.eloqnt.dev/llms.txt
---

# invalid-locale

Flags a messages file whose locale the runtime doesn't recognize.

## Why this is bad

The `Intl` APIs resolve an unknown tag to the runtime's default rather than rejecting it, so plural rules, number formats, and dates all quietly come out as the default locale's.

## Examples

The locale comes from the filename, so a name the runtime can't parse is incorrect.

Examples of **incorrect** code for this rule:

```text title="messages/"
spanish.json
```

Examples of **correct** code for this rule:

```text title="messages/"
es.json
```

---

For an index of every eloqnt/cli documentation page, see [https://cli.eloqnt.dev/llms.txt](https://cli.eloqnt.dev/llms.txt).
