<commit_before>if (typeof formdesigner === 'undefined') {
    var formdesigner = {};
}

formdesigner.controller = (function () {
    "use strict";
    var that = {},
        DEBUG_MODE = false,
        FORM_SAVED = true,
        saveButton = SaveButton.init({
            save: function() {
                that.validateAndSaveXForm();
            },
            unsavedMessage: 'Are you sure you want to exit? All unsaved changes will be lost!'
        });
    that.saveButton = saveButton;
    
    var initFormDesigner = function () {
        xpathmodels.DEBUG_MODE = DEBUG_MODE;
        formdesigner.util.question_counter = 1;
        
        formdesigner.model.init();
        formdesigner.ui.init();
        that.setCurrentlySelectedMugType(null);
        
        if (formdesigner.opts.langs && formdesigner.opts.langs.length > 0) {
            // override the languages with whatever is passed in
            for (var i = 0; i < formdesigner.opts.langs.length; i++) {
                formdesigner.model.Itext.addLanguage(formdesigner.opts.langs[i]);
            }
            formdesigner.model.Itext.setDefaultLanguage(formdesigner.opts.langs[0]);
        } else if (formdesigner.model.Itext.languages.length === 0) {
            formdesigner.model.Itext.addLanguage("en");
        }
        
        formdesigner.currentItextDisplayLanguage = formdesigner.opts.displayLanguage ||
                                                   formdesigner.model.Itext.getDefaultLanguage();
        
        that.on('question-creation', function () {
           that.setFormChanged(); //mark the form as 'changed'
        });

        <commit_msg>way to get the language name for langcode<commit_after>if (typeof formdesigner === 'undefined') {
    var formdesigner = {};
}

formdesigner.controller = (function () {
    "use strict";
    var that = {},
        DEBUG_MODE = false,
        FORM_SAVED = true,
        saveButton = SaveButton.init({
            save: function() {
                that.validateAndSaveXForm();
            },
            unsavedMessage: 'Are you sure you want to exit? All unsaved changes will be lost!'
        });
    that.saveButton = saveButton;
    
    var initFormDesigner = function () {
        xpathmodels.DEBUG_MODE = DEBUG_MODE;
        formdesigner.util.question_counter = 1;
        
        formdesigner.model.init();
        formdesigner.ui.init();
        that.setCurrentlySelectedMugType(null);
        
        if (formdesigner.opts.langs && formdesigner.opts.langs.length > 0) {
            // override the languages with whatever is passed in
            for (var i = 0; i < formdesigner.opts.langs.length; i++) {
                formdesigner.model.Itext.addLanguage(formdesigner.opts.langs[i]);
            }
            formdesigner.model.Itext.setDefaultLanguage(formdesigner.opts.langs[0]);
        } else if (formdesigner.model.Itext.languages.length === 0) {
            formdesigner.model.Itext.addLanguage("en");
        }
        
        formdesigner.currentItextDisplayLanguage = formdesigner.opts.displayLanguage ||
                                                   formdesigner.model.Itext.getDefaultLanguage();

        // fetch language names
        formdesigner.langCodeToName = {};
        _.each(formdesigner.opts.langs, function(langcode) {
            $.getJSON('/langcodes/langs.json', {term: langcode}, function(res) {
                if (res.length >= 1) {
                    formdesigner.langCodeToName[res[0].code] = res[0].name;
                    that.fire('fd-update-language-name');
                }
            });
        });
        
        that.on('question-creation', function () {
           that.setFormChanged(); //mark the form as 'changed'
        });

        
{'fraction_non_alphanumeric': 0.1134789557805008, 'fraction_numerical': 0.0034629728289824187, 'mean_word_length': 1.9108527131782946, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6295734', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1023, 'n_words': 191}