-
-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Description
Environment
Angular: 8.2.14
ngx-translate-extract: 5.0.1 and 7.0.3
Description
I'm trying to extract the string from a Pipe. This Pipe extends from TranslatePipe.
Code
import { DatePipe } from '@angular/common';
import { ChangeDetectorRef, Pipe, PipeTransform } from '@angular/core';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
@Pipe({
name: 'containerStatusLabel',
pure: false
})
export class StatusLabelPipe extends TranslatePipe implements PipeTransform {
constructor(
private translateService: TranslateService,
private changeDetectorRef: ChangeDetectorRef
) {
super(translateService, changeDetectorRef);
}
transform(status: string, args?: string): string {
switch (status) {
case 'DELIVERED':
return super.transform('Delivered');
case 'SHIPPED':
return super.transform('Shipped');
case 'IN STOCK':
return super.transform('In stock');
case 'CANCELLED':
return super.transform('Cancelled');
case 'CREATED':
return super.transform('Created');
default:
return '';
}
}
}
How to reproduce
ngx-translate-extract -f pot -i ./src -o ./i18n/template2.pot
Result
The strings( 'Delivered', 'Shipped', ...) are not extracted. I don't see these strings in the pot file.
Expected
The strings should be present in the pot file.
Someone has the same error or has an idea how to get the strings in the pot file without using a marker?
Metadata
Metadata
Assignees
Labels
No labels