lukasgeiter / gettext-extractor

A flexible and powerful Gettext message extractor with support for JavaScript, TypeScript, JSX and HTML.
MIT License
98 stars 21 forks source link

Cannot extract context strings from identifiers #53

Open chkt opened 2 years ago

chkt commented 2 years ago

Hi,

thanks for your great work! I encountered a smallish problem where the extractor fails to extract context strings that are not string literals from js/ts files. I like to put all my context strings into a typescript const enum to keep them dry.

Would it be feasible for your parser to resolve identifiers that point to stringifyable const and enum values in context arguments?

lukasgeiter commented 2 years ago

Hi, that's an interesting idea. While it is technically possible, I'm not sure it's in the scope of this project. I'll keep this issue open for the time being though. If other people are looking for this too, I might reconsider.