<commit_before>#! /usr/bin/env node

/**
    @module d3plus-locale
    @summary Parses source code for uses of i18next.
    @desc This script will scan every locally installed d3plus module and construct language JSON for each supported localization.
    @TODO Potentially move this script to d3plus-common?
**/

const log = require("./log")("compiling locales"),
      shell = require("shelljs");

log.timer("compiling translations");
const langs = ["en-US", "es-ES"];
shell.exec(`i18next .. -r -l ${langs.join(",")} -f 'locale.t' --fileFilter '*.js' --directoryFilter 'd3plus-*,src' -o ../d3plus-common/src/locales`, {silent: true}, (code, stdout) => {
  if (code) log.fail();
  else log.done();
  shell.echo(stdout);
  shell.exit(code);
});<commit_msg>adds namespace to locale parser<commit_after>#! /usr/bin/env node

/**
    @module d3plus-locale
    @summary Parses source code for uses of i18next.
    @desc This script will scan every locally installed d3plus module and construct language JSON for each supported localization.
    @TODO Potentially move this script to d3plus-common?
**/

const log = require("./log")("compiling locales"),
      shell = require("shelljs");

log.timer("compiling translations");
const langs = ["en-US", "es-ES"];
shell.exec(`i18next .. -r -l ${langs.join(",")} -n d3plus -f 'locale.t' --fileFilter '*.js' --directoryFilter 'd3plus-*,src' -o ../d3plus-common/src/locales`, {silent: true}, (code, stdout) => {
  if (code) log.fail();
  else log.done();
  shell.echo(stdout);
  shell.exit(code);
});
{'fraction_non_alphanumeric': 0.17100130039011704, 'fraction_numerical': 0.01235370611183355, 'mean_word_length': 3.9012738853503186, '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': '291294', 'n_tokens_mistral': 513, 'n_tokens_neox': 504, 'n_words': 152}