2

I want to modify this attribute by programmatically
After many times research i found this class in lib magento

Magento\Framework\View\Page\Config

Unfortunately magento team set locale in construct function so i can't use plugin (intercepts) to modify it

public function __construct(
    //Some injection here
) {
   // cut some lines here
   $this->setElementAttribute(
        self::ELEMENT_TYPE_HTML,
        self::HTML_ATTRIBUTE_LANG,
        strstr($this->localeResolver->getLocale(), '_', true)
   );
}

Is there a better way to modify this attribute ?

I have different page html with seperate locale config from backend, and i want to set lang attribute for my own page with selected locale

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.