<commit_before>module.exports = function override(config, env) {
    // const fs = require('fs')
    // const _ = require('lodash')
    // const flat = require('flat')
    // const locales = fs.readdirSync('src/locale').filter((name) => /^[^\\.]/.test(name))
    // const messages = {}
    //
    // locales.map((locale) =>
    //     messages[locale] = require(`locale/${locale}/translations.json`)
    // )
    //
    // _.chain(locales)
    //     .map((locale) => require(`locale/${locale}/translations.json`))
    //     .map((messages) =>
    //         _.chain(flat.flatten(messages))
    //             .pickBy(_.identity)
    //             .keys()
    //             .value())
    //     .tap(console.log)
    //     .intersectionBy()
    //     .tap(console.log)
    //     .value()
    


    configureCssModuleLoader(config.module.rules)
    return config;

    function configureImportsLoaders(importsLoaders) {
        Object.keys(importsLoaders).forEach(path =>
            config.module.rules = (config.module.rules || []).concat({
                test: require.resolve(path),
                enforce: 'pre',
                use: 'imports-loader?' + importsLoaders[path]
            })
        )
    }

    /**
     * Find the /\.css$/ matching rule with a css-loader.
     * Exclude /\.module\.css$/.
     * Clone it to match /\.module\.css$/, and enable module support.
     */
    function configureCssModuleLoader(o) {
        if (o instanceof Array)
            return o.find((item, i) => {
                if (item instanceof Object && 'test' in item && String(item.test) === '/\\.css$/') {<commit_msg>validate all translations exist<commit_after>module.exports = function override(config, env) {
    // const fs = require('fs')
    // const _ = require('lodash')
    // const flat = require('flat')
    // const locales = fs.readdirSync('src/locale').filter((name) => /^[^\\.]/.test(name))
    // const messages = {}
    //
    // locales.map((locale) =>
    //     messages[locale] = require(`locale/${locale}/translations.json`)
    // )
    //
    // _.chain(locales)
    //     .map((locale) => require(`locale/${locale}/translations.json`))
    //     .map((messages) =>
    //         _.chain(flat.flatten(messages))
    //             .pickBy(_.identity)
    //             .keys()
    //             .value())
    //     .tap(console.log)
    //     .intersectionBy()
    //     .tap(console.log)
    //     .value()
    
    const fs = require('fs')
    const _ = require('lodash')
    const flat = require('flat')
    const locales = fs.readdirSync('src/locale').filter((name) => /^[^\\.]/.test(name))
    
    const keys = _.chain(locales)
        .map((locale) => require(`./src/locale/${locale}/translations`))
        .map((messages) =>
            _.chain(flat.flatten(messages))
                .pickBy(_.identity)
                .keys()
                .value())
        .value()
    
    const incompleteKeys = _.difference(_.union(...keys), _.intersection(...keys))
    if (incompleteKeys)
        throw `Missing translations: \n${incompleteKeys.join('\n')}`

    configureCssModuleLoader(config.module.rules)
    return config

    function configureImportsLoaders(importsLoaders) {
        Object.keys(importsLoaders).forEach(path =>
            config.module.rules = (config.module.rules || []).concat({
                test: require.resolve(path),
                enforce: 'pre',
                use: 'imports-loader?' + importsLoaders[path]
            })
        )
    }

    /**
     * Find the /\.css$/ matching rule with a css-loader.
     * Exclude /\.module\.css$/.
     * Clone it to match /\.module\.css$/, and enable module support.
     */
    function configureCssModuleLoader(o) {
        if (o instanceof Array)
            return o.find((item, i) => {
                if (item instanceof Object && 'test' in item && String(item.test) === '/\\.css$/') {
{'fraction_non_alphanumeric': 0.17905491698595147, 'fraction_numerical': 0.0, 'mean_word_length': 1.8213256484149856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '925923', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1155, 'n_words': 208}