diff --git a/src/parsers/pipe.parser.ts b/src/parsers/pipe.parser.ts index 73a2c89..fb1dfb2 100644 --- a/src/parsers/pipe.parser.ts +++ b/src/parsers/pipe.parser.ts @@ -9,7 +9,8 @@ import { Binary, LiteralMap, LiteralArray, - Interpolation + Interpolation, + MethodCall } from '@angular/compiler'; import { ParserInterface } from './parser.interface'; @@ -131,6 +132,10 @@ export class PipeParser implements ParserInterface { return this.getTranslatablesFromAsts(ast.expressions); } + if (ast instanceof MethodCall) { + return this.getTranslatablesFromAsts(ast.args); + } + return []; } diff --git a/tests/parsers/pipe.parser.spec.ts b/tests/parsers/pipe.parser.spec.ts index ba5e3ab..861ab04 100644 --- a/tests/parsers/pipe.parser.spec.ts +++ b/tests/parsers/pipe.parser.spec.ts @@ -195,4 +195,10 @@ describe('PipeParser', () => { const keys = parser.extract(contents, templateFilename).keys(); expect(keys).to.deep.equal([]); }); + + it('should extract strings from piped arguments inside a function calls on templates', () => { + const contents = `{{ callMe('Hello' | translate, 'World' | translate ) }}`; + const keys = parser.extract(contents, templateFilename).keys(); + expect(keys).to.deep.equal([`Hello`, `World`]); + }); });