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

Interpolation Issue with static HTML string when switching languages #310

Open
xamino opened this issue Sep 2, 2016 · 0 comments
Open

Comments

@xamino
Copy link

xamino commented Sep 2, 2016

Consider the following:

<span translate
    translate-params-email="'<a href=\'email@example.com\'>email@example.com</a>'"
    translate-params-url="'<a href=\'http://example.com\' target=\'_blank\'>example.com</a>'">
Some text which refers to the clickable email address {{email}} and also points to the url {{url}}.
</span>

This works for the initial page load, meaning the interpolation will correctly insert the email and url links. However if I then switch the language to German, the German text is shown without the interpolation. Instead the variables are simply missing (they don't show at the locations where the variables are placed in the translation).

I tried using an unsafe filter since that may be related, but it starts an endless iteration loop (since it changes the string) and thus doesn't work either. It does not seem to an issue with the way I specify the string (Using HTML escaping for the quotes etc) either.

Please let me know if I'm doing something wrong or if this may be an issue in search of a fix.

I believe this pull request and this issue may be related since they implemented this feature.

EDIT: Just checked to make sure: this doesn't work even with just a normal string given, so it does not seem to be an issue related to safe / unsafe HTML insertion (replacing string with 'email@example.com' still won't show up when switching languages).

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

1 participant