public function htmlLang()
    {
        $request = $this->requestStack->getCurrentRequest();
        $locale = $request ? $request->getLocale() : $this->locale;

        return str_replace('_', '-', $locale);
    }
public function htmlLang()
    {
        $request = $this->requestStack->getCurrentRequest();
        $locale = $request ? $request->getLocale() : $this->locale;

        return str_replace('_', '-', $locale);
    }
public function htmlLang ( ) { $ request = $ this -> requestStack -> getCurrentRequest ( ) ; $ locale = $ request ? $ request -> getLocale ( ) : $ this -> locale ; return str_replace ( '_' , '-' , $ locale ) ; }
Returns the language value for in tags where the language attribute is
required. The underscore '_' in the locale will be replaced with a
hyphen '-'.

@return string
Returns the language value for in tags where the language attribute is required . The underscore _ in the locale will be replaced with a hyphen - .