<?php
/**
 * Maho
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2023 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @var Mage_Page_Block_Switch $this */
?>
<?php if(count($this->getStores())>1): ?>
<div class="form-language">
    <label for="select-language"><?= $this->__('Your Language:') ?></label>
    <select id="select-language" title="<?= $this->__('Your Language') ?>" onchange="window.location.href=this.value" class="flags">
    <?php foreach ($this->getStores() as $_lang): ?>
        <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
        <option value="<?= $_lang->getCurrentUrl() ?>" style="background-image:url('<?= $this->getSkinUrl('images/flags/flag_'.$_lang->getCode().'.gif') ?>');"<?= $_selected ?>><?= $this->escapeHtml($_lang->getName()) ?></option>
    <?php endforeach ?>
    </select>
</div>
<?php endif ?>
