mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* implements #2276 * add localization and website contributing guides * fix typo * Update build-website.yml * add note for write-translations * attempt 2 at making CI build the stubs * experiment: delete part of the stubs... expecting ci to rebuild it * write-translations for dev and check- for ci * catch promise errors * commit the missing mdx instruction * fix English grammar in check report
38 lines
956 B
JavaScript
38 lines
956 B
JavaScript
const {i18n: {locales}} = require('./docusaurus.config.js');
|
|
const util = require('util');
|
|
const exec = util.promisify(require('child_process').exec);
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
const os = require('os');
|
|
const dircompare = require('dir-compare');
|
|
const writeTranslations = require('./write-translations.js')
|
|
|
|
|
|
const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'yew-website-'));
|
|
|
|
|
|
async function main() {
|
|
await new Promise(resolve => {
|
|
fs.cp('i18n', temp, {recursive: true}, () => {
|
|
resolve()
|
|
})
|
|
})
|
|
|
|
await writeTranslations()
|
|
|
|
const result = await dircompare.compare(temp, 'i18n', {compareContent: true});
|
|
if (result.same) {
|
|
console.log("Translations unchanged");
|
|
} else {
|
|
console.error("Translations changed, please run `npm run write-translations` to generate the stubs");
|
|
process.exitCode = 1;
|
|
}
|
|
}
|
|
|
|
main()
|
|
.catch(e => console.error(e))
|
|
|
|
|
|
|
|
|