i18n-polyfill
i18n-polyfill copied to clipboard
Messages are not extracted when parameter and field name don't match
I hade a small issue where all my message wasn't extracted. My implementation looked like:
private _i18n: I18n;
constructor(i18n: I18n) {
this._i18n = i18n;
}
ngOnInit() {
this._msg = this._i18n({'value': 'There was an error while submitting your registration', 'description': 'Sign up error (fallback)'});
}
These are not picked up due to the fact that the parameter in the constructor and not named the same as the field: (i18n != _i18n
).
It's probably by design, but maybe a note about this in the README?