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

fix(directive): avoid recursive errors when using keys with whitespaces #1016

Merged
merged 2 commits into from
Feb 12, 2020
Merged

Conversation

BADF00D
Copy link
Contributor

@BADF00D BADF00D commented Feb 19, 2019

The problem with issue #998 is, that at some node.originalContent in translate.directive.ts is overwritten by a translation that was assigned previously. So the translation key gets destroyed and no further translations could be made.

The bugfix introduces a new variable (node.lookupKey) that is generated once (by this.key or the trimmed content of the node) and used in further translations instead of calculating it over and over again.

Since I changed no existing tests, I assume that alle existing functionality still works. I added new test to verify that the problem with white spaces are fixed.

@ocombe
Copy link
Member

ocombe commented Feb 5, 2020

Closing this as it was fixed by another PR (35427b0)

ocombe
ocombe previously approved these changes Feb 12, 2020
@ocombe ocombe changed the title Fixes issue #998 fix(directive): avoid recursive errors when using keys with whitespaces Feb 12, 2020
@ocombe ocombe merged commit 24b7b2b into ngx-translate:master Feb 12, 2020
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

Successfully merging this pull request may close these issues.

3 participants