1

I'm trying to use ng-pluralize to conditionally display HTML based on yml translations. Unfortunately, the HTML is ignored by ng-pluralize and displayed as a string literal with the count interpolated. Is it possible to do what I'm trying to?

HAML

%span(ng-if="user.streak_count" ng-pluralize 
count="user.streak_count" when="{'1': #{t('.one_streak_html')},
'other': #{t('.streak_html')} }")

YML

streak_html: "'<b>{}</b> days in a row'"
one_streak_html: "'<b>{}</b> day in a row'"

Displayed

<b>2</b> days in a row
gards
  • 555
  • 1
  • 6
  • 18
  • Did you solve it? We are running into a similar issue here. – Robert Sep 04 '15 at 16:30
  • 1
    @Robert I can't seem to figure out where, but I remember reading about an open issue in the repo saying that it wasn't currently supported. Ended up with something more ugly unfortunately :( – gards Sep 10 '15 at 20:31

1 Answers1

0

This seems a little bit late, but in case anyone still has some problem with this one, I created directives that can solve this problem. It can be found here

You can see it in action here