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

var fs = require('fs');
var fetch = require('node-fetch');
var values = require('object-values');
var unique = require('just-unique');
var chalk = require('chalk');
var extraAliases = require('./locales/extra_aliases.js');

/**
 * CONSTANTS
 */

var ALL_LANGS = ['ar', 'an', 'hy', 'ast', 'eu', 'bn_IN', 'nb', 'bg', 'zh_CN',
                 'zh_TW', 'da', 'de', 'eo', 'et', 'fo', 'fi', 'fr',
                 'gl', 'ht', 'he', 'hi', 'hch', 'id', 'ga', 'is', 'it', 'ja',
                 'ja_HIRA', 'km', 'kn', 'kk', 'ca', 'ko', 'hr', 'ku',
                 'cy', 'ky', 'la', 'lv', 'lt', 'mk', 'ms', 'ml', 'mr', 'maz',
                 'mn', 'my', 'nah', 'ne', 'el', 'nl', 'no', 'nn', 'or', 'os',
                 'oto', 'ote', 'pap', 'fa', 'fil', 'pl', 'pt', 'pt_BR', 'ro',
                 'ru', 'rw', 'sv', 'sr', 'sk', 'sl', 'es', 'sw', 'tzm', 'ta',
                 'th', 'cs', 'tr', 'ug', 'uk', 'hu', 'vi'];

// ISO Codes for all the language forums.
var FORUM_LANGS = ['de', 'es', 'fr', 'zh_CN', 'pl', 'ja', 'nl' , 'pt', 'it',
                   'he', 'ko', 'nb', 'tr', 'el', 'ru', 'ca', 'id'];

var ENGLISH_COMMANDS = require('./commands.js');
var COMMAND_SPECS = unique(ENGLISH_COMMANDS.map(cmd => cmd[0]));
var PALETTE_SPECS = [
  'Motion', 'Looks', 'Sound', 'Pen', 'Data', 'variable',
  'list', 'Events', 'Control', 'Sensing', 'Operators',
  'More Blocks', 'Tips'
];
var NEED_ALIAS = [
  'turn @turnRight %n degrees',
  'turn @turnLeft %n degrees',
  'when @greenFlag clicked'
];
var UNTRANSLATED = [
  '%n + %n',
  '%n - %n',
  '%n * %n',
  '%n / %n',
  '%s < %s',
  '%s = %s',
  '%s > %s',
  '…',
  '...'
];
var ACCEPTABLE_MISSING = [
  'turn %m.motor on for %n seconds',
  'set light color to %n',
  'play note %n for %n seconds',
  'when tilted',
  'tilt %m.xxx',
  'else',
  'end',
  '. . .',
  '%n @addInput',
  'user id',
  'if %b',
  'if %b',
  'forever if %b',
  'stop script',
  'stop all',
  'switch to costume %m.costume',
  'next background',
  'switch to background %m.backdrop',
  'background #',
  'loud?',
  'username'
];
var MATH_FUNCS = [
  'abs', 'floor', 'ceiling', 'sqrt', 'sin', 'cos', 'tan',
  'asin', 'acos', 'atan', 'ln', 'log', 'e ^', '10 ^'
];
var OSIS = [ 'other scripts in sprite', 'other scripts in stage' ];
var DROPDOWN_SPECS = [
  'A connected', 'all', 'all around',
  'B connected', 'brightness', 'button pressed', 'C connected', 'color',
  'costume name', 'D connected', 'date', 'day of week', 'don\'t rotate',
  'down arrow', 'edge', 'fisheye', 'ghost', 'hour',
  'left arrow', 'left-right', 'light', 'minute', 'month',
  'mosaic', 'motion', 'mouse-pointer',
  'myself', 'off', 'on', 'on-flipped', 'other scripts in sprite',
  'pixelate', 'previous backdrop', 'resistance-A',
  'resistance-B', 'resistance-C', 'resistance-D', 'reverse', 'right arrow',
  'second', 'slider', 'sound', 'space', 'Stage', 'that way', 'this script',
  'this sprite', 'this way', 'up arrow', 'video motion', 'whirl', 'year'
];

/**
 * CONSTANTS END
 */

/**
 * Arguments
 *
 * ./fetch_translations [language code | all]
 *<commit_msg>fetch translations:  not acceptable missing<commit_after>#!/usr/bin/env node

var fs = require('fs');
var fetch = require('node-fetch');
var values = require('object-values');
var unique = require('just-unique');
var chalk = require('chalk');
var extraAliases = require('./locales/extra_aliases.js');

/**
 * CONSTANTS
 */

var ALL_LANGS = ['ar', 'an', 'hy', 'ast', 'eu', 'bn_IN', 'nb', 'bg', 'zh_CN',
                 'zh_TW', 'da', 'de', 'eo', 'et', 'fo', 'fi', 'fr',
                 'gl', 'ht', 'he', 'hi', 'hch', 'id', 'ga', 'is', 'it', 'ja',
                 'ja_HIRA', 'km', 'kn', 'kk', 'ca', 'ko', 'hr', 'ku',
                 'cy', 'ky', 'la', 'lv', 'lt', 'mk', 'ms', 'ml', 'mr', 'maz',
                 'mn', 'my', 'nah', 'ne', 'el', 'nl', 'no', 'nn', 'or', 'os',
                 'oto', 'ote', 'pap', 'fa', 'fil', 'pl', 'pt', 'pt_BR', 'ro',
                 'ru', 'rw', 'sv', 'sr', 'sk', 'sl', 'es', 'sw', 'tzm', 'ta',
                 'th', 'cs', 'tr', 'ug', 'uk', 'hu', 'vi'];

// ISO Codes for all the language forums.
var FORUM_LANGS = ['de', 'es', 'fr', 'zh_CN', 'pl', 'ja', 'nl' , 'pt', 'it',
                   'he', 'ko', 'nb', 'tr', 'el', 'ru', 'ca', 'id'];

var ENGLISH_COMMANDS = require('./commands.js');
var COMMAND_SPECS = unique(ENGLISH_COMMANDS.map(cmd => cmd[0]));
var PALETTE_SPECS = [
  'Motion', 'Looks', 'Sound', 'Pen', 'Data', 'variable',
  'list', 'Events', 'Control', 'Sensing', 'Operators',
  'More Blocks', 'Tips'
];
var NEED_ALIAS = [
  'turn @turnRight %n degrees',
  'turn @turnLeft %n degrees',
  'when @greenFlag clicked'
];
var UNTRANSLATED = [
  '%n + %n',
  '%n - %n',
  '%n * %n',
  '%n / %n',
  '%s < %s',
  '%s = %s',
  '%s > %s',
  '…',
  '...'
];
var ACCEPTABLE_MISSING = [
  'turn %m.motor on for %n seconds',
  'set light color to %n',
  'play note %n for %n seconds',
  'when tilted',
  'tilt %m.xxx',
  'else',
  'end',
  '. . .',
  '%n @addInput',
  'user id',
  'if %b',
  'if %b',
  'forever if %b',
  'stop script',
  'stop all',
  'switch to costume %m.costume',
  'next background',
  'switch to background %m.backdrop',
  'background #',
  'loud?'
];
var MATH_FUNCS = [
  'abs', 'floor', 'ceiling', 'sqrt', 'sin', 'cos', 'tan',
  'asin', 'acos', 'atan', 'ln', 'log', 'e ^', '10 ^'
];
var OSIS = [ 'other scripts in sprite', 'other scripts in stage' ];
var DROPDOWN_SPECS = [
  'A connected', 'all', 'all around',
  'B connected', 'brightness', 'button pressed', 'C connected', 'color',
  'costume name', 'D connected', 'date', 'day of week', 'don\'t rotate',
  'down arrow', 'edge', 'fisheye', 'ghost', 'hour',
  'left arrow', 'left-right', 'light', 'minute', 'month',
  'mosaic', 'motion', 'mouse-pointer',
  'myself', 'off', 'on', 'on-flipped', 'other scripts in sprite',
  'pixelate', 'previous backdrop', 'resistance-A',
  'resistance-B', 'resistance-C', 'resistance-D', 'reverse', 'right arrow',
  'second', 'slider', 'sound', 'space', 'Stage', 'that way', 'this script',
  'this sprite', 'this way', 'up arrow', 'video motion', 'whirl', 'year'
];

/**
 * CONSTANTS END
 */

/**
 * Arguments
 *
 * ./fetch_translations [language code | all]
 *
{'fraction_non_alphanumeric': 0.2653982586262496, 'fraction_numerical': 0.0009674298613350532, 'mean_word_length': 3.3166318719554626, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1749158', 'n_tokens_mistral': 2466, 'n_tokens_neox': 2444, 'n_words': 695}