INNER CODE UNIT · TypeScript

main

multitheftauto/mtasa-blue · utils/localization/generate-translators/src/index.ts:111

async function main() {
    // Check if crowdin-report.json exists and load it, to avoid generating the report again.
    // If it doesn't exist, generate the report and save it to crowdin-report.json.
    let topMembers: Array<Member>;

    if (fsExistsSync('crowdin-report.json')) {
        topMembers = JSON.parse(await fs.readFile('crowdin-report.json', 'utf-8'));
    } else {
        topMembers = await generateTopMembersReport();
        await fs.writeFile('crowdin-report.json', JSON.stringify(topMembers, null, 2));
    }

    // Filter out the organization user from the top members list.
    if (argv.ignoreUserId) {
        topMembers = topMembers.filter(member => member.user.id !== argv.ignoreUserId);
    }

    // Filter out members without winning translations.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…