<commit_before>﻿@model Configuration
@{
    var siteLocalizations = WebRequestContext.Localization.SiteLocalizations;
    var filteredLocalizations = new List<Localization>();
    if (siteLocalizations.Count > 1)
    {
        var excludedLocalizations = new List<string>();
        if (Model.Settings.ContainsKey("suppressLocalizations"))
        {
            excludedLocalizations = Model.Settings["suppressLocalizations"].Split(',').Select(l => ("/" + l.Trim())).ToList();
        }
        foreach (var loc in siteLocalizations)
        {
            if (!excludedLocalizations.Contains(loc.Path))
            {
                filteredLocalizations.Add(loc);
            }
        }
    }
    var redirectId = WebRequestContext.PageId;
    var defaultItem = Model.Settings.ContainsKey("defaultContentLink") ? Model.Settings["defaultContentLink"].Substring(4) : null;
}
@if (redirectId != null && siteLocalizations.Count > 1)
{
    <div @Markup.Entity(Model)>
        <select class="selectpicker" data-width="auto">
            @foreach (var loc in siteLocalizations)
            {
                var parms = "localizationId=" + loc.LocalizationId + (defaultItem!=null ? "&defaultItemId=" + defaultItem:"");
                parms += "&defaultPath=" + loc.Path;
                <option value="@loc.LocalizationId" data-href="@(WebRequestContext.Localization.Path)/resolve/@(redirectId)?@parms" @(loc.LocalizationId==WebRequestContext.Localization.LocalizationId ? "selected" : "")>
                    @loc.Language
                </option>
            }
        </select>
    </div><commit_msg>fixed LanguageSelector view which wasn't using filtered list<commit_after>﻿@model Configuration
@{
    var siteLocalizations = WebRequestContext.Localization.SiteLocalizations;
    var filteredLocalizations = new List<Localization>();
    if (siteLocalizations.Count > 1)
    {
        var excludedLocalizations = new List<string>();
        if (Model.Settings.ContainsKey("suppressLocalizations"))
        {
            excludedLocalizations = Model.Settings["suppressLocalizations"].Split(',').Select(l => ("/" + l.Trim())).ToList();
        }
        foreach (var loc in siteLocalizations)
        {
            if (!excludedLocalizations.Contains(loc.Path))
            {
                filteredLocalizations.Add(loc);
            }
        }
    }
    var redirectId = WebRequestContext.PageId;
    var defaultItem = Model.Settings.ContainsKey("defaultContentLink") ? Model.Settings["defaultContentLink"].Substring(4) : null;
}
@if (redirectId != null && filteredLocalizations.Count > 1)
{
    <div @Markup.Entity(Model)>
        <select class="selectpicker" data-width="auto">
            @foreach (var loc in filteredLocalizations)
            {
                var parms = "localizationId=" + loc.LocalizationId + (defaultItem!=null ? "&defaultItemId=" + defaultItem:"");
                parms += "&defaultPath=" + loc.Path;
                <option value="@loc.LocalizationId" data-href="@(WebRequestContext.Localization.Path)/resolve/@(redirectId)?@parms" @(loc.LocalizationId==WebRequestContext.Localization.LocalizationId ? "selected" : "")>
                    @loc.Language
                </option>
            }
        </select>
    </div>
{'fraction_non_alphanumeric': 0.1329444273871661, 'fraction_numerical': 0.00184218606079214, 'mean_word_length': 2.693877551020408, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1557708', 'n_tokens_mistral': 882, 'n_tokens_neox': 858, 'n_words': 148}