Get the Language of the page

i need to know in my code what the language is of the site, found on stack overflow that this whould help "use Cake\I18n\I18n; var_dump(I18n::getLocale()); " but when i use it i get this error “(Error) - Call to undefined method Cake\I18n\I18n::getLocale() in /var/www/portal/src/View/Helper/CmsBlockHelper.php on 33” line 33 is where i do the var_dump

getLocale is available i think since 3.5 maybe you have older version?
try I18n::locale()