<commit_before>import Vue from 'vue';
import i18next from 'i18next';
import VueI18Next from '@panter/vue-i18next';

Vue.use(VueI18Next);

const i18n = new VueI18Next(i18next);

let setLanguage = function (store, req) {
    if (req && req.session) {
        if (!req.session.userData) {
            req.session.userData = {};
        }
        req.session.userData.lang = 'en';
        console.log(`Add new language 'en'`);
    }
};

export default ({app, store, req}) => {

    setLanguage(store, req);

    i18next.init({
        lng: store.state.i18n.language,
        resources: {
            en: {<commit_msg>Setting default language to english only when no session exists.<commit_after>import Vue from 'vue';
import i18next from 'i18next';
import VueI18Next from '@panter/vue-i18next';

Vue.use(VueI18Next);

const i18n = new VueI18Next(i18next);

let setLanguage = function (store, req) {
    if (req && req.session) {
        if (!req.session.userData || (req.session.userData && !req.session.userData.lang)) {
            req.session.userData = {lang: 'en'};
        }
    }
};

export default ({app, store, req}) => {

    setLanguage(store, req);

    i18next.init({
        lng: store.state.i18n.language,
        resources: {
            en: {
{'fraction_non_alphanumeric': 0.14422310756972112, 'fraction_numerical': 0.03187250996015936, 'mean_word_length': 2.738095238095238, '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': '317310', 'n_tokens_mistral': 454, 'n_tokens_neox': 429, 'n_words': 99}