-
Notifications
You must be signed in to change notification settings - Fork 154
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
Translate fails if string contains & #262
Comments
I faced the same issue.
Which would render, with no localisation:
And once the string would be localised, it could do something like:
Now, regarding this issue, I would like to say that gettext should not modify the provided keys, but look for their localisation as they are. If a key contains a &, it must not be modified in the process and look for a key containing &, or any other changes. |
Just looked into this on our site as well. I've found that it varies between directive/filter: <span translate>Login & Play</span> <!-- translates correctly -->
<span translate>Login & Play</span> <!-- fail -->
<span>{{ 'Login & Play' | translate }}</span> <!-- translates correctly -->
<span>{{ 'Login & Play' | translate }}</span> <!-- fail --> |
Can we get some help on this one? |
What's funny is fixing a bug in IE8 (a backwards system) broke current and future correct functionality (& in html text). I'll look at making a PR fix. |
Added a PR for this here, #352. |
I think the bug appears in IE11 too |
Suppose we have a case like this:
If we extract strings, the extraction will appear in your *.pot file, as expected.
But when you make translation (ie. "tester et exécuter") and generate Json files, if you load the website and select the translation, the translated string will not appear.
Instead, you will still see "Test & Execute" where you expect "tester et exécuter".
This works:
Writing "&" was required in HTML4 specifications, but it's no longer the case. According to HTML5 specifications, using "&" is valid (see: ambigious ampersands).
The text was updated successfully, but these errors were encountered: