Closed johnfrades closed 6 years ago
That's not enough information. Can you do a minimal reproduction on StackBlitz please?
@johnfrades Please re-open if still an issue and you have the reproduction.
@lephyrus @johnfrades I have the same problem:
<span translate="wizard.step" [translateParams]="{current: 1, total: 3}"></span>
throws me an error:
ERROR TypeError: Cannot read property 'current' of undefined
en.json:
"wizard": {
"step": "Step {current} of {total}"
}
Angular 5+ Translate 9.1.1
Added TranslateMessageFormatDebugCompiler
to see debug in console and it shows:
[TranslateMessageFormatCompiler] INTERPOLATE Step {current} of {total} undefined
So, this undefined
is an actual [translateParams]="{current: 1, total: 3}"
params but they are missing.
This does not work even in latest versions of translate plugins.
Angular — 7.2.5 Translate — 11.0.1 Translate Messageformat Compiler — 4.4.0
Hi, i just want to ask, i'm trying to use translate/[translate] directive but it seems it doesn't work on your library Here's the example:
Not working:
<span translate="AREAS" [translateParams]="{ count: 3 }">areas</span>
<span [translate]="'AREAS'" [translateParams]="{ count: 3 }">areas</span>
The error says"Count is undefined"
Working:
<span translate [translateParams]="{ count: 3 }">AREAS</span>
Just want to know on how to make it work with the 2 Not Working examples.