Get user selected language for Front-end

I’m trying to localize an integration the problem is that I can’t extract the language selected by the user I’m trying using the hass object in this way but it gives me a

TypeError: Cannot read properties of undefined (reading 'selectedLanguage')

 updateCard() {
 const config = this.config;
 const lang = this.hass.selectedLanguage
 const translations = {
 // Add languages ​​here
 };