Boulangerie / angular-translate-extract

Manage extraction of angular-translate in your angular projects
MIT License
7 stars 5 forks source link

ng-bind-html directive handling #11

Open myukselen opened 7 years ago

myukselen commented 7 years ago

If a constant string with inner attributes having " is used, ng-bind-html directive is not handled correctly.

For example, we want to translate this:

<div class="footer-right">Created with <i class="ion-heart"></i></div>

We change it to:

<div class="footer-right" ng-bind-html="'Created with <i class=&quot;ion-heart&quot;></i>' | translate"></div>

However this creates a json like:

{
    "Created with <i class=&quot;ion-heart&quot;></i>": "Created with <i class=&quot;ion-heart&quot;></i>"
}

Since attribute " is not handled properly, angular-translate cries with:

Translation for Created with <i class="ion-heart"></i> doesn't exist
myukselen commented 7 years ago

I have a small fix, creating a PR now.