Skip to content

Translation keys not extracted if service is not injected #111

@falu-edo

Description

@falu-edo

I use Angular v19 and @vendure/ngx-translate-extract v9.1.0.

I have following file:

export class TestModel {
  testField: string | undefined = undefined;

  constructor() {}

  public test(translateService: TranslateService): void {
    this.testField = translateService.instant('test_key');
  }
}

ngx-translate-extract fails to extract the key "test_key". When I instantiate the translateService inside the constructor, the key gets extracted. So it seems like there's a problem when the translateService is only a reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions