Skip to content

Conversation

rdeslonde
Copy link

Keys are broken by gettext if they contain ampersands that are not html-encoded. The reason is, gettext uses .html() on keys in a few places, which html-encodes ampersands (among other special characters).

The two places in gettext that break keys with amersands are in directive.js line #99 and in catalog.js line #174.

I've corrected this by comparing the original key to the "overcorrected" key, and where the original did not have an html-encoded ampersand, the html-encoded ampersand is replaced with an unencoded ampersand.

A new function rollBackOvercorrections is used for this correction. Tested and working in a large project with 1500 translated translations.

This PR only fixes ampersands, but other html-encodings can also be fixed with a simple addition to this code.

@rdeslonde
Copy link
Author

Chrome is crashing during CI for some reason.

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.

1 participant