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.
Thanks, i have been searching but could not see it!
1 Like
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)
At the top of the aforementioned page:
“You can access this manager through the Homey instance as this.homey.i18n
”
So within your device class you can use this.homey.i18n.getLanguage()
I had to move my helper function inside the class to get that one to work.