Romanchuk / angular-i18next

angular v10+ integration with i18next v19.4+
MIT License
131 stars 33 forks source link

Interpolation is not working anymore #101

Closed NiDeWe closed 1 year ago

NiDeWe commented 1 year ago

Hi, It looks like the interpolation doesn't work anymore since the last update

<div *ngIf="control.errors['maxlength']" class="e-error"> {{ 'form.format.length' | i18next : { max: control.errors['maxlength'].requiredLength } }} </div>

in my language files, i have the next value: "form": { "format": { "numbers": "Dit veld mag alleen maar cijfers bevatten", "length": "Dit veld mag maximum {{max}} karaters bevatten" } }

in the template when running, it just says : "Dit veld mag maximum {{max}} karaters bevatten" the max parameter is not resolved.

NiDeWe commented 1 year ago

We found that the error is in the next file starting from line 58: https://github.com/Romanchuk/angular-i18next/blob/9674cec8289e53448fe67c24cd543153bcb558a9/libs/angular-i18next/src/lib/I18NextService.ts#L58

the options are given as the default value...

prhc-marco commented 1 year ago

I made a fix that works for me locally, but I don't know if that's the best solution. We had the same problem in our application.

Romanchuk commented 1 year ago

@NiDeWe @prhc-marco Thank you, both! Try v15.0.5

prhc-marco commented 1 year ago

I tested a moment ago and it's works for my application