Open thomseno opened 5 years ago
The reason why I haven't implemented such an extractor already, is because of the potential complexity of such expressions. Your examples would be quite simple to parse but in some cases it might contain ternary conditionals and other more complex expressions.
However, it would be interesting to see if Angular exposes its internal parser in a way in which it could be used for this package.
I understand.
The parser from ngx-translate-extract is available here pipe.parser.ts
Maybe this helps.
The last release of ngx-translate-extract for extracting translatables using ngx-translate is almost two years old, so I thought maybe this project can fill the gap.
The extraction of HTML, TypeScript & Javascript should working out of the box, the "only" feature missing is the "pipe" pattern:
("translate" is the getText keyword for extracting messages, param is a TypeScript variable)
What do you think? Probably requires a new HTMLExtractor...