angular-gettext
angular-gettext copied to clipboard
Issue with > character on IE
Hi rubenv,
When I use a string that contains ">" on it, I get no translation on IE. Example:
scope.sentence = gettextCatalog.getString('Sentence with > on it')
<span ng-bind="sentence"></span>
On Chrome/Firefox, it works perfectly.
Thanks for your patience.
I have the exact same issue with a different character and found out that IE converts the loaded JSON file. And changes & to & so > will probably become > The translation is then not found.
That fixes it for me.
I was hitting this issue while using the translate filter:
<span>{{'Save & Next' | translate}}</span>
If I switch to using the translate directive it will work on IE... but break on Chrome and Firefox:
<span translate>Save & Next</span>
OK.
I just investigated this a bit further and the issue is not caused by IE / Edge converting the loaded JSON (that doesn't actually happen). The issue is that setStrings()
is modifying each key if the isHTMLModified
flag is set -- see here.
This was added to account for IE uppercasing tag names and re-ordering HTML attributes.
That being said, your proposed fix is the best solution for what appears to be a pretty severe issue...
Yes, see my pull-request, which determines exactly the same, and notices that the fix isn't applied at a second location.
Hello, I am also facing this issue and am in a situation where I can't use a workaround. Your fork works and fixes it but would like this to be merged upstream. Can we prioritise pull request #312? Anything I can do to help ?
Thanks
Hello
I am also interested pulling request #312. The suggested fix helped me.
Thanks
Hi,
#312 works for me too, It seems pull request is open for a while, Do you have a plan to merge it or Do you have another solution?
Thanks