1
0
Fork 0

chore: Let reconfigure generate transaltion imports for designs

This commit is contained in:
joostdecock 2023-09-27 16:16:16 +02:00
parent 773ba3a72f
commit 131e57a24c
3 changed files with 119 additions and 103 deletions

View file

@ -126,6 +126,27 @@ if (!SITEBUILD) {
)
}
}
// Step 6: Create file with all design translations
const designsI18n = `/*
* This file is auto-generated by the reconfigure script
* Any changes will be overwritten next time the repo is reconfigured
*/
` + Object.keys(designs)
.map(design => `import { i18n as ${design} } from '@freesewing/${design}'`)
.join("\n")+`
export const designs = {
` + Object.keys(designs)
.map(design => ` ${design},`)
.join("\n")+`
}
`
fs.writeFileSync(
path.join(repo.path, 'sites', 'shared', 'i18n', 'designs.mjs'),
repo.templates.pluginTests
)
// All done
log.write(chalk.green(' All done\n'))
process.exit()