Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue Polyconseil#37 - Extract strings only when expression is a gett…
…ext function This commit is a fix for issue Polyconseil#37. The problem came from the extractor that was trying to extract the strings arguments of any gettext-like node without making sure that the type of the current node was a CallExpression. This fix prevents the extractor to automatically extract strings or variables or whatever called like a vue-gettext function. How to test: - setup a vue file containing decoys looking like some gettext functions like: <template> <h1>{{ message }}<h1> </template> <script> import $gettext from '@helper/gettext'; export default { name: "$gettext", // because some people are actually weird computed: { message() { return this.$gettext('Hello world from the $gettext function'); } } } </script> - Run extract-cli with this file. Expected results - The string "Hello world from the $gettext function" has been successfully extracted without any error.
- Loading branch information