I am trying to set language ico in the frontend.
I try to get the language name using Mage::getStoreConfig('general/country/default');
but I get an error:
This is my setting.phtml
<?php
$id = $block->getIdModifier() ? '-' . $block->getIdModifier() : '';
?>
<div class="custom-group setting-links dropdown" id="setting-links<?php echo $id?>">
<a class="action toggle switcher-trigger" id="setting-links" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-cog"> </i><?php echo Mage::getStoreConfig('general/country/default'); ?>
</a>
<div class="setting-links-options dropdown-menu" aria-labelledby="setting-links">
<div class="switcher-currency-wrapper">
<?php echo $this->getChildHtml('currency_custom') ?>
</div>
<div class="switcher-language-wrapper">
<?php echo $this->getChildHtml('store_language_custom') ?>
</div>
</div>
</div>
This generates an error :
PHP Fatal error: Uncaught Error: Class 'Mage' not found in
/var/www/html/app/design/frontend/Venustheme/fasony/Magento_Theme/templates/html/setting.phtml:15
Best Answer
You can get the current using laguage by below code:
OR
Now use getLocale() to get laguage: