<commit_before>module.exports = function(grunt) {
  grunt.registerMultiTask('lyria_i18n', function() {
    var files = this.filesSrc;
    var options = this.options({
      namespace: 'mygame',
      name: 'i18n'
    });
    
    var content = {};
    
    for (var i = 0, j = files.length; i < j; i++) {
      (function(file) {
        content = grunt.util._.merge(content, grunt.file.readJSON(file));
      })(files[i]);
    }
    
    var fileContent = 'define("' + options.namespace + '/' + options.name + '", ' + JSON.stringify(content) + ');';
    
    grunt.file.write('src/generated/i18n.js', fileContent);
  });
};<commit_msg>Updated i18n task to create grouped localization<commit_after>var path = require('path');

module.exports = function(grunt) {
  grunt.registerMultiTask('lyria_i18n', function() {
    var files = this.filesSrc;
    var options = this.options({
      namespace: 'mygame',
      name: 'i18n'
    });
    
    var content = {};
    
    for (var i = 0, j = files.length; i < j; i++) {
      (function(file) {
        var shortName = path.basename(file).split(path.extname(file))[0];
        
        content[shortName] = content[shortName] || {};
        content[shortName] = grunt.file.readJSON(file);
      })(files[i]);
    }
    
    var fileContent = 'define("' + options.namespace + '/' + options.name + '", ' + JSON.stringify(content) + ');';
    
    grunt.file.write('src/generated/i18n.js', fileContent);
  });
};
{'fraction_non_alphanumeric': 0.1781292984869326, 'fraction_numerical': 0.011691884456671253, 'mean_word_length': 2.7403598971722367, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5165367', 'n_tokens_mistral': 501, 'n_tokens_neox': 487, 'n_words': 89}