yassinedoghri / astro-i18next

An astro integration of i18next + some utility components to help you translate your astro websites!
https://astro-i18next.yassinedoghri.com
MIT License
498 stars 36 forks source link

How to generate mutilple languages pages when default language page files changed #60

Closed findlay-best-wishes closed 1 year ago

findlay-best-wishes commented 1 year ago

I exec astro-generate when default language pages files changed, but astro-generate could emit the change of default languages pages files. such as:

// package.json
"scripts": {
    "dev": "astro dev",
    "start": "astro dev",
    "build": "astro build",
    "preview": "astro preview",
    "astro": "astro",
    "gen:i18n": "astro-i18next generate"
  },
// genI18n.js
chokidar
  .watch(['src/pages/**/*', '!src/pages/en/**/*'])
  .on('all', (event, path) => {
    console.log(event, path, 'timeout gen i18n pages');
    execSync('npm run gen:i18n')
    // generate('', 'zh', 'en')
  });
yassinedoghri commented 1 year ago

Closing in favor of #110, thanks for the issue.