# Access the current user's language in a plugin

**URL:** https://meta.discourse.org/t/access-the-current-users-language-in-a-plugin/111814
**Category:** Translations
**Created:** [3월 16, 2019, 10:18오후 UTC](https://meta.discourse.org/t/access-the-current-users-language-in-a-plugin/111814 "2019-03-16T22:18:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![permacultureProgram](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/permacultureprogram/32/108924_2.png) [@permacultureProgram](https://meta.discourse.org/u/permacultureProgram)
#### Post date: [3월 16, 2019, 10:18오후 UTC](https://meta.discourse.org/t/access-the-current-users-language-in-a-plugin/111814/1 "2019-03-16T22:18:48Z")

</div>

Is it possible to access a logged in user’s language settings via the plugin api in javascript?

I.e.: in my plugin initializer:

```plaintext
function initializePlugin(api) {
  const currentUser = api.getCurrentUser();
  console.log(currentUser.language) // Is this possible?
}

```

Looking through the object, I’m not seeing the field I would use. It does look like it’s accessible through Ruby:

```plaintext
user.effective_local

```

Is that the only place?

---

<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: [3월 17, 2019, 8:57오후 UTC](https://meta.discourse.org/t/access-the-current-users-language-in-a-plugin/111814/2 "2019-03-17T20:57:39Z")

</div>

`I18n.locale` has the current user’s locale.
