i18n-polyfill icon indicating copy to clipboard operation
i18n-polyfill copied to clipboard

Messages are not extracted when parameter and field name don't match

Open fredrikredflag opened this issue 6 years ago • 0 comments

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?

fredrikredflag avatar Feb 15 '18 13:02 fredrikredflag