How to get the current language of the store?

You can use both \Magento\Store\Api\Data\StoreInterface or Magento\Framework\Locale\Resolver class to get the current language of the store. 1) By using \Magento\Store\Api\Data\StoreInterface Class With objectManager: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $store = $objectManager->get('Magento\Store\Api\Data\StoreInterface'); echo $store->getLocaleCode(); With Dependency Injection: protected $_store; public function __construct( ... \Magento\Store\Api\Data\StoreInterface $store, ... ) { ... $this->_store = $store; ... } Now you can use getLocaleCode() function to get…

Continue Reading How to get the current language of the store?