1

I am trying to google it but I only get irrelevant results... How I can translate store view names in this language-switcher dropdown? I also tried "Translate Inline" but it doesnt give me more info. Check screenshot:

language-switcher-not-translated

0

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.

|improve this answer|||||
  • 1
    I get: PHP Fatal error: Call to undefined function htmlEscape() – Alexandros Oct 22 '16 at 7:48
  • 1
    The correct syntax is $this->htmlEscape(__($_lang->getName())). Please correct so i accept your answer pontikare ;-) – Alexandros Oct 22 '16 at 7:51
0

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; ?>
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.