felixzapata / gulp-i18n-pug

Gulp plugin to compile Pug templates with internationalization support based on JS/JSON/YAML files
MIT License
28 stars 4 forks source link

loading locales files multiple time #8

Open Kubiskoi opened 6 years ago

Kubiskoi commented 6 years ago

Hi to all. I have 50 pug files in my src folder and two locale files: en.json and sk.json. For example en.json stores all strings for all pug files.

During compilation console output says

[12:37:34] Loading locale en [12:37:34] Reading translation data: locales/en.json [12:37:35] Loading locale en [12:37:35] Reading translation data: locales/en.json [12:37:36] Loading locale en [12:37:36] Reading translation data: locales/en.json . . . . . so it loads en.json for each .pug file.

Is there a way how to load en.json only once?

thank you

felixzapata commented 6 years ago

Hi @Kubiskoi at the moment there is no a way with the options to load only the file once. The gulp plugin should be modified in order to do that.