0
votes

I am using ngx-translate-messageformat-compiler in my Angular app. I have a component property initialised in ngOnInit:

this.translations = { count: this.selections.length, status: this.toStatus };

and in my lookup strings, I have things like this:

"markedThing": "Marked {count} thing{count, plural, =0{s} one{} other{s}} as", "closedSelections": "You've selected {count} thing{count, plural, =0{s} one{} other{s}} to close",

This all works fine, and trying the 'select' example from here:

"people": "{gender, select, male{He is} female{She is} other{They are}} {how}", also works fine.

My issue is that when I combine a select and a plural translation the translations break, no errors, just the strings in the app stay as their 'key' versions (like.this).

The one I'm trying to make work is this:

"markThing": "Mark thing{count, plural, =0{s} one{} other{s}} as {status, select, UNREAD{unread} READ{read} CLOSED{closed}}",

Any idea what I've done wrong? My template looks like this:

{{'markThing' | translate:translations}}

1

1 Answers

0
votes

For anyone coming across this, in a select, an 'other' option is required.