# How to use translation from client.fa\_IR.yml in javascript code?

**URL:** <https://meta.discourse.org/t/how-to-use-translation-from-client-fa-ir-yml-in-javascript-code/60367>\
**Category:** Support\
**Created:** [3 Aprile 2017, 11:44am UTC](https://meta.discourse.org/t/how-to-use-translation-from-client-fa-ir-yml-in-javascript-code/60367 "2017-04-03T11:44:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alavi1412](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alavi1412/32/67721_2.png) [@Alavi1412](https://meta.discourse.org/u/Alavi1412)\
**Post date:** [3 Aprile 2017, 11:44am UTC](https://meta.discourse.org/t/how-to-use-translation-from-client-fa-ir-yml-in-javascript-code/60367/1 "2017-04-03T11:44:55Z")

</div>

I wrote a plugin and I want to use some of the strings in config/locales/client.fa\_IR.yml in my java script code(NOT handlebars) but I don’t know how?  
Can anyone help me?  
For exmaple I have:

```plaintext
fa_IR:
  js:
    user:
      reputation: "اعتبار شما"

```

And I want to use the string in my java script code.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [3 Aprile 2017, 12:18pm UTC](https://meta.discourse.org/t/how-to-use-translation-from-client-fa-ir-yml-in-javascript-code/60367/2 "2017-04-03T12:18:11Z")

</div>

Once the locale on your instance is set to `fa_IR` via the site setting, you can access that translation via `I18n.t("user.reputation'')`.

---

<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:** [21 Maggio 2019, 3:18pm UTC](https://meta.discourse.org/t/how-to-use-translation-from-client-fa-ir-yml-in-javascript-code/60367/3 "2019-05-21T15:18:01Z")

</div>



---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [27 Maggio 2019, 1:10am UTC](https://meta.discourse.org/t/how-to-use-translation-from-client-fa-ir-yml-in-javascript-code/60367/4 "2019-05-27T01:10:01Z")

</div>


