Translate store language label in magento frontend
-
06-10-2020 - |
Solution
copy file app/design/frontend/base/default/template/page/switch/languages.phtml
into your theme
add below code
echo $this->__(<Text to translate>);
you want to translate
$this->escapeHtml($_lang->getName())
so
$this->__($this->escapeHtml($_lang->getName()))
Your final code
<?php if(count($this->getStores())>1): ?>
<div class="form-language">
<label for="select-language"><?php echo $this->__('Your Language:') ?></label>
<select id="select-language" title="<?php echo $this->__('Your Language') ?>" onchange="window.location.href=this.value">
<?php foreach ($this->getStores() as $_lang): ?>
<?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
<option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->__($this->escapeHtml($_lang->getName())) ?></option>
<?php endforeach; ?>
</select>
</div>
<?php endif; ?>
Add entry in csv file for translation
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange