filaraujo / gulp-i18n-localize

localization plugin for gulp
MIT License
8 stars 5 forks source link

Plugin not using the modified json files #2

Closed mgazelle closed 8 years ago

mgazelle commented 8 years ago

Gulp task: gulp.task('i18n', function () { return gulp.src('./src/html/index.html') .pipe(i18n({ delimeters: ['{{', '}}'], locales: ['nl', 'fr', 'de', 'en'], ignoreErrors: false, localeDir: config.langDir })) .on("error", notify.onError(function (error) { return "Error: " + error.message; })) .pipe(gulp.dest(config.distDir)); }); I have a lang directory with four files: en.json, de.json, nl.json and fr.json If I modify the html file then everything works fine. if I modify the json file and then run manually "Gulp i18n" then everything gets translated and modified as expected If I run gulp and then modify one of this json files, then the task gets triggered using gulp.watch but the translated HTML page is not reflecting the changes in the language file although the time stamp shows it has been newly created. Is it a matter of cached version?

VincentRoth commented 6 years ago

Hi, I run into the same issue.

I found that is requireDir that return cached file content. There is a PR currently opened to add the noCache option.

I may create then a PR to use this option within gulp-i18n-localize. I do not know if you are OK with that and then if you prefer to set the noCache options has always true or expose it in the options to set it.