Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nggettext_extract silently drops non *.html input #271

Open
leamas opened this issue Feb 28, 2016 · 1 comment
Open

nggettext_extract silently drops non *.html input #271

leamas opened this issue Feb 28, 2016 · 1 comment

Comments

@leamas
Copy link

leamas commented Feb 28, 2016

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.

@cawa-93
Copy link

cawa-93 commented Jul 26, 2016

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/'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants