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

Js with variables #6

Open
batball opened this issue Jun 30, 2022 · 1 comment
Open

Js with variables #6

batball opened this issue Jun 30, 2022 · 1 comment

Comments

@batball
Copy link

batball commented Jun 30, 2022

How to scan js with variables?
eg: translate("string" + test['status'] );

currently it gives a exception

@oscarotero
Copy link
Member

The scanner doesn't know the value of test['status'] so it cannot get the translation id.
If you need to add dynamic values in your translations, use the second argument:

translate('string :status', {':status': test['status']});

or sprintf syntax:

translate('string %s', test['status']);

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