{if file_exists("templates/$template/includes/common/overwrites/language-chooser-dropdown.tpl")}
     {include file="./overwrites/language-chooser-dropdown.tpl"}
{else}
    <div class="dropdown-menu dropdown-language-search dropdown-lazy {if ($RSThemes['pages'][$templatefile]['config']['isFullPage'] == "1" || $RSThemes['pages'][$templatefile]['name'] == "sidebar") && $type == "login"}dropdown-menu-center{else} dropdown-menu-right{/if}" {*id="languageChooserContent"*}>
        {if $templatefile|strstr:"modules/addons/LagomOrderForm"}
            {if $currentpagelinkback|strstr:"?"}
                {$currentpagelinkback = rtrim($currentpagelinkback, '&amp;')}
                {$divChar = "&amp;"}
            {else}
                {$currentpagelinkback = rtrim($currentpagelinkback, '?')}
                {$divChar = "?"}
            {/if}
        {elseif $currentUrl|strstr:"?"}
            {$currentpagelinkback = rtrim($currentpagelinkback, '&amp;')}
            {$divChar = "&amp;"}
        {else}
            {if substr($currentpagelinkback, -1) != '&'}
                {$currentpagelinkback = rtrim($currentpagelinkback, '?')}
                {$divChar = "?"}
            {/if}
        {/if}
        <input type="hidden" data-language-select-value value="{$activeLocale.localisedName}">
        <input type="hidden" data-language-select-backlink value="{$currentpagelinkback}{$divChar}">
        <input type="hidden" data-language-select-lang value="{$_LANG['upgradeService']['select']}">
        <div class="dropdown-header input-group align-center">
            <i class="input-group-icon lm lm-search"></i>
            <input class="form-control" placeholder="{$_LANG.search}..." type="text" data-language-select-search>
        </div>
        <div class="nav-divider"></div>
        <div class="dropdown-menu-items has-scroll" data-language-select-list>
        {foreach $locales as $locale}
            <div class="dropdown-menu-item {if $activeLocale.language == $locale.language}active{/if}" data-value="{$locale.language}" data-language="{$locale.localisedName}">
                {if $pageType == "website" && $currentpagelinkback|strstr:"cmsid"}
                    {$divChar = ""}
                    {$url = "?"|explode:$currentpagelinkback}
                    {$url2 = "&amp;"|explode:$url[1]}
                    {$stringToReplace = "`$url2[0]`"}
                {else}
                    {$stringToReplace = ""}
                {/if}
                <a tabindex="0" href="{$currentpagelinkback|replace:$stringToReplace:""}{$divChar}language={$locale.language}" rel="nofollow">
                    <span class="language-flag flag-{$locale.language}">
                        <img class="lazyload hidden" aria-hidden="true" alt="{$locale.language}" data-src="{$WEB_ROOT}/templates/{$template}/assets/img/flags/{$locale.language}.svg"/>
                    </span>
                    <span class="language-text">{$locale.localisedName}</span>
                </a>
            </div>
        {/foreach}
        </div>
        <div class="dropdown-menu-item dropdown-menu-no-data">
            <span class="text-info text-large">
                {$_LANG.norecordsfound}
            </span>
        </div>                  
    </div>
    {if isset($RSThemes['addonSettings']['hover_triggered_submenu_expansion']) && $RSThemes['addonSettings']['hover_triggered_submenu_expansion'] == "enabled" && (($RSThemes.layouts.templateLayout != 'left-nav' && $RSThemes.layouts.templateLayout != 'left-nav-wide') || (isset($navtype) && $navtype == "secondary"))}
        <div class="dropdown-menu-filler"></div>
    {/if}
{/if}