claudetech / node-static-i18n

HTML static pages i18n tool
https://www.npmjs.com/package/static-i18n
MIT License
102 stars 21 forks source link

Output directory structure breaks when running multiple times #36

Open ChrisDoernen opened 4 years ago

ChrisDoernen commented 4 years ago

Hi, thanks for the handy tool, exactly what I was looking for. When I run the command multiple times, the output gets nested below a folder of the locale "de", see screenshot attached.

I use the following command: yarn static-i18n -i en -i de --outputDefault /en/index.html --fixPaths false --output-dir ./website ./website.

When I delete the generated folders ("en/" and "de/") first with rimraf for example, the output is correct. But that prevents live reloading on file change to work (I am using the live-server package) which is a major drawback in the development workflow.

Best Chris

static-i18n

ChrisDoernen commented 4 years ago

... the right index.html files were transformed correctly though. So cleaning up the redundtant directories in "de" with rimraf is a valid workaround for me at the moment. But that may not be good when there are more than 2 languages involved :)

danhper commented 4 years ago

Hi and sorry for the huge delay. If you would have time to send a PR it would be really great. If you won't have time, please let me know and I will try to have a look.