# エラーチェックを行うロケールファイルの確認方法

**URL:** https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527
**Category:** Translations
**Created:** [2018 年 9 月 6 日午後 4:04 UTC](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527 "2018-09-06T16:04:49Z")
**Posts on this page:** 6
**Page:** 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: [2018 年 9 月 6 日午後 4:04 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)

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [2018 年 9 月 6 日午後 4:21 UTC](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527/2 "2018-09-06T16:21:53Z")

</div>

First of all, gotta love Discourse and its community, you’re the best example how to approach solving problems with other people 🙂

So, I took a look into the console and that’s what I got:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/6/5600ebebf56109dbf088e996f4ac2afb18a27c55.png)

So, it means there’s a lot of not properly translated sentences, yeah? Or there may be some warnings which don’t always affect badly?

---

<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: [2018 年 9 月 6 日午後 4:25 UTC](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527/3 "2018-09-06T16:25:28Z")

</div>

No, all of those are errors and should be fixed.

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [2018 年 9 月 6 日午後 4:25 UTC](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527/4 "2018-09-06T16:25:49Z")

</div>

Gotcha, I’m gonna work on this 🙂

---

<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: [2018 年 9 月 6 日午後 5:06 UTC](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527/13 "2018-09-06T17:06:53Z")

</div>



---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [2023 年 6 月 11 日午後 7:20 UTC](https://meta.discourse.org/t/how-to-check-locale-files-for-errors/96527/14 "2023-06-11T19:20:49Z")

</div>

「`Failed to check locale files for XX`（すべての言語）と表示された場合、どうすればよいですか？

Pavillon Plugin で多言語対応を試しましたが、無効にしてアンインストールしました。数週間かけて言語ファイルを修正しています :)」
