function processFile(inputFile, outputFile, filter) {
    let extension = path.extname(inputFile);
    if (extension == ".html") {
        const data = fs.readFileSync(inputFile, "utf8");
        if (filter(inputFile, false, data)) return;
        for (const locale of i18n.locales) {
            const replacedData = replaceFileContents(data, path.dirname(inputFile), locale);
            if (locale == i18n.defaultLocale) {
                fs.writeFileSync(outputFile, replacedData);
                console.log(`${inputFile} -> ${outputFile}`);
            }
            let pathWithLanguageCode = outputFile.substring(0, outputFile.length - extension.length) + "." + locale + extension;
            fs.writeFileSync(pathWithLanguageCode, replacedData);
            console.log(`${inputFile} -> ${pathWithLanguageCode}`);
        }
    } else {
        const data = fs.readFileSync(inputFile);
        if (filter(inputFile, false, data)) return;
        fs.writeFileSync(outputFile, data);
        console.log(`${inputFile} -> ${outputFile}`);
    }
}
Copy inputFile to outputFile, possibly modifying it in the process.

@param {string} inputFile path
@param {string} outputFile path
@param {function(string, boolean, string):boolean} filter takes path, whether it is a directory and data (or null if directory), returns true if the file should be left out