@@ -101,7 +101,7 @@ angular.module('gettext').factory('gettextCatalog', ["gettextPlurals", "$http",
101101 return catalog ;
102102} ] ) ;
103103
104- angular . module ( 'gettext' ) . directive ( 'translate' , [ "gettextCatalog" , "$parse" , "$animate" , "$compile" , function ( gettextCatalog , $parse , $animate , $compile ) {
104+ angular . module ( 'gettext' ) . directive ( 'translate' , [ "gettextCatalog" , "$parse" , "$animate" , "$compile" , "$window" , function ( gettextCatalog , $parse , $animate , $compile , $window ) {
105105 // Trim polyfill for old browsers (instead of jQuery)
106106 // Based on AngularJS-v1.2.2 (angular.js#620)
107107 var trim = ( function ( ) {
@@ -121,6 +121,8 @@ angular.module('gettext').directive('translate', ["gettextCatalog", "$parse", "$
121121 }
122122 }
123123
124+ var msie = parseInt ( ( / m s i e ( \d + ) / . exec ( angular . lowercase ( $window . navigator . userAgent ) ) || [ ] ) [ 1 ] , 10 ) ;
125+
124126 return {
125127 restrict : 'A' ,
126128 terminal : true ,
@@ -132,6 +134,14 @@ angular.module('gettext').directive('translate', ["gettextCatalog", "$parse", "$
132134 var msgid = trim ( element . html ( ) ) ;
133135 var translatePlural = attrs . translatePlural ;
134136
137+ if ( msie <= 8 ) {
138+ // Workaround fix relating to angular adding a comment node to
139+ // anchors. angular/angular.js/#1949 / angular/angular.js/#2013
140+ if ( msgid . slice ( - 13 ) === '<!--IE fix-->' ) {
141+ msgid = msgid . slice ( 0 , - 13 ) ;
142+ }
143+ }
144+
135145 return {
136146 post : function ( scope , element , attrs ) {
137147 var countFn = $parse ( attrs . translateN ) ;
0 commit comments