<commit_before>(function() {
  'use strict';

  var i18n = require('i18n');

  module.exports = function(req, res, next) {
    var lang = req.headers.language.split(' ')[1];
    res.setLocale(lang);

    next();
  };
}());
<commit_msg>adding condition if the language is not yet present<commit_after>(function() {
  'use strict';

  var i18n = require('i18n');

  module.exports = function(req, res, next) {
    if(!req.headers.language) {
      var lang = req.headers.language.split(' ')[1];
      res.setLocale(lang);
    }
    next();
  };
}());

{'fraction_non_alphanumeric': 0.18761384335154827, 'fraction_numerical': 0.018214936247723135, 'mean_word_length': 3.3307086614173227, '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': '3206329', 'n_tokens_mistral': 196, 'n_tokens_neox': 186, 'n_words': 41}