<commit_before>define(['jquery'], function ($) {

    function changeLanguage(lang) {
        if (location.search.indexOf("language") > -1) {
            location.search = location.search.replace(/language=[a-z][a-z]/, "language=" + lang);
        } else if (location.search == "") {
            var url = location.href;
            if (url.substr(url.length - 1) == '?') {
                location.href += "language=" + lang;
            } else {
                location.href += "?language=" + lang;
            }
        } else {
            location.href += "&language=" + lang;
        }
    }

    $('#header-signin').click(function () {
        'login?callbackUrl={0}'.format(encodeURIComponent(location.href)).goto();
    });

    $('.language-selection').each(function (index, action) {
        var language = $(action).attr('data-language');
        $(action).click(function () {
            changeLanguage(language);
        });
    });

});<commit_msg>#218 Correction of language change<commit_after>define(['jquery'], function ($) {

    function changeLanguage(lang) {
        if (location.search.indexOf("language") > -1) {
            location.search = location.search.replace(/language=[a-z][a-z]/, "language=" + lang);
        } else if (location.search == "") {
            location.search = "language=" + lang;
        } else {
            location.search += "&language=" + lang;
        }
    }

    $('#header-signin').click(function () {
        'login?callbackUrl={0}'.format(encodeURIComponent(location.href)).goto();
    });

    $('.language-selection').each(function (index, action) {
        var language = $(action).attr('data-language');
        $(action).click(function () {
            changeLanguage(language);
        });
    });

});
{'fraction_non_alphanumeric': 0.1888072357263991, 'fraction_numerical': 0.0045223289994347085, 'mean_word_length': 2.2536764705882355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6815119', 'n_tokens_mistral': 497, 'n_tokens_neox': 490, 'n_words': 76}