---
url: https://akinozgen.github.io/datagrids/errors/DG015.md
description: >-
  One datagrids warning or error code — the message, when it happens and how to
  fix it.
---

# DG015: Invalid locale

```text
[datagrids DG015] `{tag}` is not a valid locale; it is ignored.
```

Printed with `console.warn`, once per distinct message. `configure({ warnings: false })` silences it.

## When it happens

The `locale` option, `configure({ locale })` or `<html lang>` holds a value the `Intl` APIs reject
(`<html lang="1">`, `locale: "tr_TR"`). Number and date formatting would throw on it, so the grid
skips it and takes the next candidate: the browser's language, then `"en"`.

## How to fix it

Use a BCP 47 tag (`tr`, `tr-TR`, `en-GB`). When the value comes from user settings, validate it on the
server before writing it into the page.

## Related

* [All warning codes](/errors/)
* [Grid options](/reference/options)
* [Static API & configure()](/reference/static)
