language switcher

Create Language Switcher

ist easy to create a language switcher

How to create ?

Full Example


// #1
<select class="language-switcher">
    <?php foreach( enabledLanguagesList() as $lang ) : ?>
        <option value="<?php echo $lang ?>">
            <?php echo languageNameInEnglish($lang) ?>
        </option>
    <?php endforeach; ?>
</select>

// #2
<select class="language-switcher">
    <?php foreach( enabledLanguagesList() as $lang ) : ?>
        <option value="<?php echo $lang ?>">
            <?php echo languageNameTongue($lang) ?>
        </option>
    <?php endforeach; ?>
</select>
 

Output



#1





#2

// #1
<ul class="language-switcher">
    <?php foreach( enabledLanguagesList() as $lang ) : ?>
        <li>
            <a href="<?php echo logatyLink'', $lang) ?>">
                <?php echo languageNameInEnglish($lang) ?>
            </a>
        </li>
    <?php endforeach; ?>
</ul>

// #2
<ul class="language-switcher">
    <?php foreach( enabledLanguagesList() as $lang ) : ?>
        <li>
            <a href="<?php echo logatyLink('', $lang) ?>">
                <?php echo languageNameTongue($lang) ?>
            </a>
        </li>
    <?php endforeach; ?>
</ul>


 


// #1
<ul class="language-switcher">
    <?php foreach( enabledLanguagesList() as $lang ) : ?>
        <li>
            <a href="<?php echo logatyLink'', $lang) ?>">
                <img src="<?php echo getLanguageFlag($lang) ?>" />
            </a>
        </li>
    <?php endforeach; ?>
</ul>