Smile\ElasticsuiteCore\Helper\IndexSettings::getLanguageCode PHP Method

getLanguageCode() public method

Return the locale code (eg.: "en") for a store.
public getLanguageCode ( integer | string | Magento\Store\Api\Data\StoreInterface $store ) : string
$store integer | string | Magento\Store\Api\Data\StoreInterface The store.
return string
    public function getLanguageCode($store)
    {
        $store = $this->getStore($store);
        $languageCode = current(explode('_', $this->getLocaleCode($store)));
        return $languageCode;
    }

Usage Example

Example #1
0
 /**
  * {@inheritDoc}
  */
 public function getAnalysisSettings($store)
 {
     $language = $this->helper->getLanguageCode($store);
     return $this->analysisConfig->get($language);
 }