# 在新版本中，I18n 应该被什么取代？

**URL:** https://meta.discourse.org/t/what-should-i18n-be-replaced-with-in-new-versions/90944
**Category:** Support
**Created:** [2018年六月28日 11:25 UTC](https://meta.discourse.org/t/what-should-i18n-be-replaced-with-in-new-versions/90944 "2018-06-28T11:25:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [2018年六月28日 11:25 UTC](https://meta.discourse.org/t/what-should-i18n-be-replaced-with-in-new-versions/90944/1 "2018-06-28T11:25:38Z")

</div>

after some updates in discourse, this code-line ` I18n.translations.en.js.filters.unanswered = { title: "unanswered", help: "questions with no answers" };` doesn’t work anymore for non-English locales.

does anyone know what should it be replaced with?

a sample use case of the line: [Add /users to top nav](https://meta.discourse.org/t/add-users-to-top-nav/63681/10)

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2018年六月28日 21:00 UTC](https://meta.discourse.org/t/what-should-i18n-be-replaced-with-in-new-versions/90944/2 "2018-06-28T21:00:14Z")

</div>

For Persian, something like this should work:

`I18n.translations.fa_IR.js.filters.unanswered = { title: "Unanswered", help: "Topics that have not be answered" };`

If themes are adding a translation in this way, they need to be checking that the locale is defined. Something like this would be safe in a theme:

```plaintext
 if (I18n.translations.en) {
    I18n.translations.en.js.filters.unanswered = { title: "Unanswered", help: "Topics that have not be answered" };
}

```

I’m not sure what the best practice for doing this should be. Doing something like this seems to be safe:

```plaintext
let currentLocale = I18n.currentLocale();
I18n.translations[currentLocale].js.filters.unanswered = { title: "Unanswered", help: "Topics that have not be answered" };

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2018年七月30日 05:47 UTC](https://meta.discourse.org/t/what-should-i18n-be-replaced-with-in-new-versions/90944/4 "2018-07-30T05:47:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
