<commit_before>(function() {
    var readingModeToggle = document.querySelector('.reading-mode-toggle');

    readingModeToggle.addEventListener('click', function() {
        var body = document.querySelector('body.page');
        body.classList.toggle('light');
        if (body.classList.contains('light')) {
            readingModeToggle.classList.remove('dark');
            readingModeToggle.classList.add('light');
        } else {
            readingModeToggle.classList.remove('light');
            readingModeToggle.classList.add('dark');
        }
    }, false);

    var langToggle = document.querySelector('.lang-toggle');
    var langToggleText = document.querySelector('.lang-toggle-text');
    var html = document.querySelector('html');

    langToggle.addEventListener('click', function() {
        var currentLang = html.getAttribute('lang');
        console.log(currentLang);
        if (currentLang === 'ru') {
            html.setAttribute('lang', 'en');
            langToggleText.innerHTML = 'EN';
        } else {
            html.setAttribute('lang', 'ru');
            langToggleText.innerHTML = 'RU';
        }
    }, false);
})();
<commit_msg>add improvement made by anonymous<commit_after>(function() {
    var readingModeToggle = document.querySelector('.reading-mode-toggle');

    readingModeToggle.addEventListener('click', function() {
        var body = document.querySelector('body.page');

        body.classList.toggle('light');

        if (body.classList.contains('light')) {
            readingModeToggle.classList.remove('dark');
            readingModeToggle.classList.add('light');
        } else {
            readingModeToggle.classList.remove('light');
            readingModeToggle.classList.add('dark');
        }
    }, false);

    var langToggle = document.querySelector('.lang-toggle');
    var langToggleText = document.querySelector('.lang-toggle-text');
    var html = document.querySelector('html');

    langToggle.addEventListener('click', function() {
        var currentLang = html.getAttribute('lang');
        var lang, locale;
        switch (currentLang) {
            case 'en':
                lang = 'ru';
                locale = 'RU';
                break;
            default:
                lang = 'en';
                locale = 'EN';
        }
        html.setAttribute('lang', lang);
        langToggleText.innerHTML = locale;
    }, false);
})();

{'fraction_non_alphanumeric': 0.14362360709863806, 'fraction_numerical': 0.0, 'mean_word_length': 2.4431818181818183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7229452', 'n_tokens_mistral': 600, 'n_tokens_neox': 609, 'n_words': 104}