angular-gettext
angular-gettext copied to clipboard
nggettext_extract silently drops non *.html input
New to this, possibly making all kind of errors. That said, it seems that the nggettext_extract grunt task silenlty drops any input pattern not ending in 'html'. E. g. , when using something like
files: {
// 'po/template.pot': ['foo.cshtml']
'po/template.pot': ['foo.html']
}
foo.html works whereas foo.cshtml silently fails.
Not accepting non-html files becomes a problem in any templating system, some of which are used together with angular. I understand that changing this behaviour might break some use cases, so there might be some specific configuration involved in accepting all kinds of input files.
Or, perhaps, there already is such an option, I just don't find it? The need seems obvious to me (?)
On top of this, the task completing without a single translation should IMHO generate a warning.
I completely agree. When you try to extract * .tpl files (which is a valid html code), nothing happens. Translations were not found. At the same time there has been no reports of missing files. As a solution to propose to list all used formats. For example, for Gulp:
return gulp.src(['src/**/*.html', 'src/**/*.tpl', 'src/**/*.js'])
.pipe(gettext.extract('all.pot', {
extensions: {
htm: 'html',
html: 'html',
php: 'html',
phtml: 'html',
tml: 'html',
ejs: 'html',
erb: 'html',
js: 'js',
tag: 'html',
jsp: 'html',
tpl: 'html', // <- my Template extension
}
}))
.pipe(gulp.dest('po/'));