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

Add "_" to gettext functions list #5

Open
epi-JRD opened this issue Feb 28, 2022 · 2 comments
Open

Add "_" to gettext functions list #5

epi-JRD opened this issue Feb 28, 2022 · 2 comments

Comments

@epi-JRD
Copy link

epi-JRD commented Feb 28, 2022

Hello,

Would it be possible to add "_" to the list of functions handled by JsScanner, same way as in PHPScanner?
I opened a PR including the addition in case you agree.

Best,

Juliette

@oscarotero
Copy link
Member

Hi Juliette.

The reason to don't include _ to the list of functions is because this scanner use the same functions as JS translator package. In the PHP Scanner the _ function exists if you have the php gettext extension enabled.

You can configure the functions in this way:

$scanner = new JsScanner();
$scanner->setFunctions([
    '_' => 'gettext',
    '__' => 'gettext',
]);

@epi-JRD
Copy link
Author

epi-JRD commented Feb 28, 2022

Ok, thanks for the quick answer and the getaround!

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

2 participants