<commit_before>/*
 * grunt-missing-i18n
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function (grunt) {
  var missingI18n = require('./lib/missing-i18n').init(grunt);

  function logNumFiles(numFiles) {
    return numFiles + ' ' + grunt.util.pluralize(numFiles, 'file/files');
  }

  grunt.registerMultiTask('missingI18n', 'Find files with unlocalized UI strings.', function () {
    var done = this.async();

    missingI18n.findMissingI18n(this.filesSrc, function (results) {
      var numFiles = Object.size(results);
      if (numFiles <= 0) {
        grunt.log.ok('No missing translations in ' + logNumFiles);
        done(true);
        return;
      }

      grunt.log.error('Found missing translations in ' + logNumFiles(numFiles));
      Object.each(results, function (result) {
        grunt.log.error(result);

        var missingTranslations = results[result];
        missingTranslations.forEach(function (missing) {
          grunt.log.writeln('"\t' + missing + '"');
        });
      });

      done(numFiles);
    });
  });
};<commit_msg>Removed debug quotes<commit_after>/*
 * grunt-missing-i18n
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function (grunt) {
  var missingI18n = require('./lib/missing-i18n').init(grunt);

  function logNumFiles(numFiles) {
    return numFiles + ' ' + grunt.util.pluralize(numFiles, 'file/files');
  }

  grunt.registerMultiTask('missingI18n', 'Find files with unlocalized UI strings.', function () {
    var done = this.async();

    missingI18n.findMissingI18n(this.filesSrc, function (results) {
      var numFiles = Object.size(results);
      if (numFiles <= 0) {
        grunt.log.ok('No missing translations in ' + logNumFiles);
        done(true);
        return;
      }

      grunt.log.error('Found missing translations in ' + logNumFiles(numFiles));
      Object.each(results, function (result) {
        grunt.log.error(result);

        var missingTranslations = results[result];
        missingTranslations.forEach(function (missing) {
          grunt.log.writeln('\t' + missing);
        });
      });

      done(numFiles);
    });
  });
};
{'fraction_non_alphanumeric': 0.14497307001795331, 'fraction_numerical': 0.01526032315978456, 'mean_word_length': 2.931216931216931, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2320244', 'n_tokens_mistral': 731, 'n_tokens_neox': 693, 'n_words': 140}