angular-gettext icon indicating copy to clipboard operation
angular-gettext copied to clipboard

Issue with > character on IE

Open leozzitowned opened this issue 8 years ago • 8 comments

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.

leozzitowned avatar Jul 19 '16 15:07 leozzitowned

I have the exact same issue with a different character and found out that IE converts the loaded JSON file. And changes & to &amp; so > will probably become &gt; The translation is then not found.

SamanthaAdrichem avatar Sep 19 '16 15:09 SamanthaAdrichem

That fixes it for me.

SamanthaAdrichem avatar Sep 20 '16 07:09 SamanthaAdrichem

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>

danjarvis avatar Oct 12 '16 14:10 danjarvis

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...

danjarvis avatar Oct 12 '16 17:10 danjarvis

Yes, see my pull-request, which determines exactly the same, and notices that the fix isn't applied at a second location.

SamanthaAdrichem avatar Oct 12 '16 19:10 SamanthaAdrichem

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

bassoGeorge avatar Mar 06 '17 12:03 bassoGeorge

Hello

I am also interested pulling request #312. The suggested fix helped me.

Thanks

alexeykorsakov avatar Mar 29 '17 06:03 alexeykorsakov

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

korkmaz avatar May 01 '17 22:05 korkmaz