How can i get de locale code in the current shop?

For example es-ES or en-EN.

I tried

$storeId =  $this->_storeManager->getStore()->getId();
    * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    $localeCode =  $this->scopeConfig->getValue('general/locale/code', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);

Hope This helps.

  • Kindly thumb up and accept the ans if it worked. – Mohammad Mujassam May 30 '17 at 18:08
  • It is already accepted – Miguel May 30 '17 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.