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

extraction from es6 inline html #118

Open
ctaepper opened this issue Nov 16, 2015 · 4 comments
Open

extraction from es6 inline html #118

ctaepper opened this issue Nov 16, 2015 · 4 comments

Comments

@ctaepper
Copy link

for reasons not important to this issue, i have my html template inside es6 .js files which export the templates as string

// template.js
export default `
  <h1 translate>Heading</h1>
  <p translate>Text in paragraph</p>
`;

notice the backtick which enables multiline html inside js files

when i run the extractor on these file (angular-gettext-cli@1.0.5, using angular-gettext-tools@1.2.0) the tags from these template files dont get extracted

is it me, or is this a bug?

@rubenv
Copy link
Owner

rubenv commented Nov 17, 2015

Probably a bug, I don't think we fully parse ES6 yet. We probably need to switch to a new HTML parser to fix that.

@ctaepper
Copy link
Author

any ideas what to do meanwhile? :)

@CNBorn
Copy link

CNBorn commented Jan 5, 2016

I think the issue here should be Can angular-gettext-tools parse HTML inside JS file? The answer is no from what I've read from the source code, extracting JS and HTML are now from different functions and they are not interrelated which means it could only recognize HTML stuff from a .html file.

I'd like to see this been implemented as well, as I'm writing Angular Component, bring both presentation and logic of a component together in a single file is whole lot better for code organization. But this approach cannot be used without this feature.

BTW For parsing ES6: I'm not sure if angular-gettext-tools can fully parse ES6 yet, but it's dependency espree does support ES6 now and angular-gettext-tools does have plenty ecmafeatures enabled.

@mattbrunetti
Copy link

@ctaepper I believe this issue is resolved by PR #163 .. Can you confirm and close this issue?

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

4 participants