# Get Language

**URL:** https://community.homey.app/t/get-language/89674
**Category:** Developers
**Created:** [September 18, 2023, 1:43pm UTC](https://community.homey.app/t/get-language/89674 "2023-09-18T13:43:26Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)
#### Post date: [September 18, 2023, 1:43pm UTC](https://community.homey.app/t/get-language/89674/1 "2023-09-18T13:43:26Z")

</div>

How can I get the current language set for the Homey? I would prefer an object returning a code i.e. en,sv,nl so I can format i.e. Dates properly to the user.

---

<div class="post-metadata">

### Author: ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)
#### Post date: [September 18, 2023, 2:50pm UTC](https://community.homey.app/t/get-language/89674/2 "2023-09-18T14:50:05Z")

</div>

> **[ManagerI18n - Homey Apps SDK v3](https://apps-sdk-v3.developer.homey.app/ManagerI18n.html#getLanguage)**

---

<div class="post-metadata">

### Author: ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)
#### Post date: [September 18, 2023, 3:05pm UTC](https://community.homey.app/t/get-language/89674/3 "2023-09-18T15:05:09Z")

</div>

Thanks, i have been searching but could not see it!

---

<div class="post-metadata">

### Author: ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)
#### Post date: [September 20, 2023, 6:39pm UTC](https://community.homey.app/t/get-language/89674/4 "2023-09-20T18:39:56Z")

</div>

Okey using import{Manager, Device} from ‘homey’ does not expose under l18n any getLanguage(). what Im I doing wrong? I should mention that I’m in code for the device (device.ts)

---

<div class="post-metadata">

### Author: ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)
#### Post date: [September 20, 2023, 7:03pm UTC](https://community.homey.app/t/get-language/89674/5 "2023-09-20T19:03:13Z")

</div>

At the top of the aforementioned page:  
_“You can access this manager through the [Homey](https://apps-sdk-v3.developer.homey.app/Homey.html) instance as `this.homey.i18n`”_

So within your device class you can use `this.homey.i18n.getLanguage()`

---

<div class="post-metadata">

### Author: ![MathiasT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mathiast/32/84876_2.png) [@MathiasT](https://community.homey.app/u/MathiasT)
#### Post date: [September 20, 2023, 9:02pm UTC](https://community.homey.app/t/get-language/89674/6 "2023-09-20T21:02:43Z")

</div>

I had to move my helper function inside the class to get that one to work.

---

<div class="post-metadata">

### Author: ![Elmar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/elmar/32/131852_2.png) [@Elmar](https://community.homey.app/u/Elmar)
#### Post date: [December 9, 2024, 7:08pm UTC](https://community.homey.app/t/get-language/89674/7 "2024-12-09T19:08:20Z")

</div>

Is it possible to fetch the language in the index.html for widgets?  
It looks like this isn’t working het but i want to set the locale of momentjs here in index.html (script)

---

<div class="post-metadata">

### Author: ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)
#### Post date: [December 9, 2024, 7:33pm UTC](https://community.homey.app/t/get-language/89674/8 "2024-12-09T19:33:01Z")

</div>

I also needed language and timezone. I passed it with the widget data from the app to the widget.

---

<div class="post-metadata">

### Author: ![Elmar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/elmar/32/131852_2.png) [@Elmar](https://community.homey.app/u/Elmar)
#### Post date: [December 9, 2024, 8:05pm UTC](https://community.homey.app/t/get-language/89674/9 "2024-12-09T20:05:47Z")

</div>

How?

---

<div class="post-metadata">

### Author: ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)
#### Post date: [December 9, 2024, 8:20pm UTC](https://community.homey.app/t/get-language/89674/10 "2024-12-09T20:20:15Z")

</div>

Ah, sorry.  
I use realtime events to pass data to the widget. Iy you are using the API, you can do the same.

> <https://github.com/RonnyWinkler/com.tibber.athom/blob/master/drivers/home/device.ts#L405>

---

<div class="post-metadata">

### Author: ![Elmar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/elmar/32/131852_2.png) [@Elmar](https://community.homey.app/u/Elmar)
#### Post date: [December 10, 2024, 12:23pm UTC](https://community.homey.app/t/get-language/89674/11 "2024-12-10T12:23:47Z")

</div>

I think you van just use Homey.\_language
