# How to check locale files for errors

**URL:** <https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527>\
**Category:** Translations\
**Created:** [September 6, 2018, 4:04pm UTC](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527 "2018-09-06T16:04:49Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [September 6, 2018, 4:04pm UTC](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527/1 "2018-09-06T16:04:49Z")

</div>

Have you ever wondered why a translated string isn’t used by Discourse? Is Discourse [showing wrong numbers and dates](https://meta.discourse.org/t/incorrect-time-delta-on-post-ru-interface-only/83390) when a locale other than English is used? Are you seeing [“Invalid Format” errors](https://meta.discourse.org/t/some-syntax-error-related-to-polish-language/96281) in some parts of Discourse?

It’s quite likely that an error in some translations is causing those problems. There’s a rake task that lists all problems found for a specific locale. You can run it inside your Docker container as well as in your development environment by executing the following command:

```plaintext
rake i18n:check[locale]
# replace "locale" with the short name of the language, e.g. "bg" for Bulgarian

```

The output for Bulgarian currently looks like this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/c/dceda075dbea50d66f8936427367450299a4017d.png)

Are you curious about errors in all locales? Simply run `rake i18n:check` without the `[locale]` parameter…

### How can I fix those errors?

1. Visit [Transifex](https://www.transifex.com/discourse/discourse-org/) and select the correct language and resource.

2. Search for the problematic translation by using the `key:` filter.

### Why are there so many “Missing interpolation key” errors?

Some languages should always use the `%{count}` variable in pluralized strings. The rake tasks knows about them and always prints an error when that variable is missing. See [Always use %{count} variable when translating pluralized strings](https://meta.discourse.org/t/always-use-count-variable-when-translating-pluralized-strings/83969) for more about that.

### How can I fix Message Format errors?

Translating Message Format can be a bit tricky, but there’s a pretty good topic that should get you started: [Message Format support for localization](https://meta.discourse.org/t/message-format-support-for-localization/7035)

---

_[View the full topic](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527)._
