<?php
/**
 * Copyright © 2016 maijindou.com All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

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