How I can translate store view labels?
-
03-10-2020 - |
La solution
Edited:
It's a long shot but remove your code and try to replace this:
echo $this->htmlEscape($_lang->getName())
With this:
echo $this->htmlEscape(__($_lang->getName()))
Then try translate inline again.
Autres conseils
I know that isnt the best way but i added some if's in my languages.phtml file:
<?php foreach ($this->getStores() as $_lang): ?>
<?php echo $this->getCurrentStoreId() ?>
<?php if ($this->getCurrentStoreId()== 2): ?>
<?php if ($_lang->getName() == "Greek"): ?>
<option value="<?php echo $_lang->getCurrentUrl() ?>" <?php if($lang_flag): ?> data-image="<?php echo $this->getSkinUrl('images/flags/'.$_lang->getCode().'.png'); ?>" <?php endif; ?>><?php echo "Ελληνικά" ?></option>
<?php elseif ($_lang->getName() == "English"): ?>
<option value="<?php echo $_lang->getCurrentUrl() ?>" <?php if($lang_flag): ?> data-image="<?php echo $this->getSkinUrl('images/flags/'.$_lang->getCode().'.png'); ?>" <?php endif; ?>><?php echo "Αγγλικά" ?></option>
<?php endif; ?>
<?php else: ?>
<option value="<?php echo $_lang->getCurrentUrl() ?>" <?php if($lang_flag): ?> data-image="<?php echo $this->getSkinUrl('images/flags/'.$_lang->getCode().'.png'); ?>" <?php endif; ?> <?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>
<?php endif; ?>
<?php endforeach; ?>
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange