Comments (2)
Thank you for reporting this bug! It's actually an I found recently myself.
I'm currently working on a solution but it will likely take quite a bit of time for development and testing...
The problem is that the extractor basically has to understand when a comment belongs to a call expression or not. Taking the example with an assignment and adding an additional one:
var foo = getText('Foo'); // Comment
var foo = getText('Foo'),
bar = 42; // Comment
Now for the developer it's clear that while in the first example the comment belongs to message, in the second it doesn't. When going trough the AST however, it's not so easy to figure that out. Of course it's possible to do, but the challenge is to keep it relatively generic while avoiding all kinds of false positives.
Anyway, I'm working on it and will update this issue once I have a fix ready.
from gettext-extractor.
I've significantly improved the extraction of comments in the latest release. In version 2.1.0, the context of the expression is taken into account which means comments, including those around variable declarations, are extracted much more intelligently.
from gettext-extractor.
Related Issues (20)
- Update typescript dependency requirement HOT 2
- Can not add multiline strings with JsExtractor HOT 1
- Allow #
- Allow #| comments HOT 1
- Add message does not allow null values HOT 1
- illegal operation on a directory HOT 3
- no strings found on keybase/client project HOT 1
- Add support for empty-attribute selectors HOT 1
- String templates are not parsed HOT 2
- Cannot extract context strings from identifiers HOT 1
- how can use for extract strings not translated into XREngine repo? HOT 10
- No extraction sometimes HOT 3
- Provide content options for HTML attribute extractor HOT 7
- Variable with type and without initializer causes error HOT 1
- gettext-extractor does not support private # HOT 1
- gettext-extractor fails when glob matches a directory HOT 2
- extracting comments not working in assignment HOT 3
- HtmlExctractors returns more characters than expected HOT 2
- Add async support
- Convert to ASM?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gettext-extractor.