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

Incorrect matching of translation key when the attribute interpolation is preceded by an expression with a literal string #105

Closed
Serrulien opened this issue Aug 4, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Serrulien
Copy link
Contributor

Serrulien commented Aug 4, 2021

Current behavior

<tag [name]="foo('fg')" quz="{{ 'key1' | transloco }}"></tag>
<tag [name]="'bar'" quz="{{ 'key2' | transloco }}"></tag>

Both lines will output a translation key nammed quz.

Expected behavior

Should output two translation keys nammed key1 and key2.

Steps To Reproduce

Nothing uncommon: create a blank angular project, add transloco and add the 2 lines in a html file.

Environment

- Keys manager version: 2.7.4
- Node version: 14.17.3
- Platform: Windows

Additional context

IMO the regexp for pipes is not accurate enough.

https://regex101.com/r/K75FbF/6
image

Contribution

I would like to make a pull request for this feature:
[ ] Yes! 🚀
[X] Maybe next time

@Serrulien Serrulien changed the title Incorrect matching of translation key when the binding attribute is preceded by an expression with a literal string Incorrect matching of translation key when the attribute interpolation is preceded by an expression with a literal string Aug 5, 2021
@shaharkazaz
Copy link
Collaborator

@Serrulien Can you please try v3? the entire template extraction was refactored 🙂

@shaharkazaz shaharkazaz added the bug Something isn't working label Oct 7, 2021
@Serrulien
Copy link
Contributor Author

Version 3.0.2 does fix this issue. Good work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants