filaraujo / gulp-i18n-localize

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

Gulp: no translations found #10

Open Demonvoda opened 4 years ago

Demonvoda commented 4 years ago

Hallo,

gulp is not recognizing the Text i want to translate. i habe edited my text in my index.html like this: ${{de.katze}}$ . gulp still cant recognize it. any idea how to fix ?

thanks in advance for ur effort.

leonelsanchesdasilva commented 4 years ago

@Demonvoda Got to simulate this with something like

gulp.task('i18n', function () {
    return new Promise(function (resolve, reject) {
        gulp.src('./dist/*.html')
            .pipe(i18n({
                locales: ['pt-PT', 'en-US'],
                localeDir: './src/locales'
            }))
            .pipe(gulp.dest('dist/'));

        resolve();
    });
});

I think the lib doesn't parse localeDir accordingly (in this case, ./src/locales). I got to make it work with

gulp.task('i18n', function () {
    return new Promise(function (resolve, reject) {
        gulp.src('./dist/*.html')
            .pipe(i18n({
                locales: ['pt-PT', 'en-US'],
                localeDir: './locales'
            }))
            .pipe(gulp.dest('dist/'));

        resolve();
    });
});