Compare commits

..

9 Commits

Author SHA1 Message Date
dependabot[bot]
0a7c2dd5f0 Bump minimatch and mocha
Bumps [minimatch](https://github.com/isaacs/minimatch) to 3.1.2 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together.


Updates `minimatch` from 3.0.4 to 3.1.2
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

Updates `mocha` from 8.3.2 to 10.1.0
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.3.2...v10.1.0)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: mocha
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 12:29:34 +00:00
dependabot[bot]
a108eb776c Bump ansi-regex from 3.0.0 to 3.0.1 (#3)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-22 09:13:58 +03:00
dependabot[bot]
a60ea65325 Bump minimist from 1.2.5 to 1.2.6 (#2)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-21 23:49:50 +03:00
dd31950151 Merge pull request #1 from unistack-org/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2022-01-12 17:36:04 +03:00
dependabot[bot]
f0cc5a2d9f Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 01:30:55 +00:00
Kim Biesbjerg
82eb652e4b Bump version 2021-04-14 10:10:21 +02:00
Kim Biesbjerg
4e91eb5fc5 Update deps (#234) 2021-04-14 10:09:26 +02:00
riot
0809e065ec fixes example call to generate i18n extracts (#225) 2021-04-14 10:03:06 +02:00
Jabi
17dfbbed84 enable piped argument on function calls (#233) 2021-04-14 10:00:44 +02:00
5 changed files with 508 additions and 918 deletions

View File

@@ -20,7 +20,7 @@ Add a script to your project's `package.json`:
}
...
```
You can now run `npm run extract-i18n` and it will extract strings from your project.
You can now run `npm run i18n:extract` and it will extract strings from your project.
## Usage

1375
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@biesbjerg/ngx-translate-extract",
"version": "7.0.3",
"version": "7.0.4",
"description": "Extract strings from projects using ngx-translate",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@@ -61,29 +61,29 @@
},
"config": {},
"devDependencies": {
"@angular/compiler": "^10.1.3",
"@angular/compiler": "^11.2.9",
"@types/braces": "^3.0.0",
"@types/chai": "^4.2.12",
"@types/chai": "^4.2.16",
"@types/flat": "^5.0.1",
"@types/gettext-parser": "4.0.0",
"@types/glob": "^7.1.3",
"@types/mkdirp": "^1.0.1",
"@types/mocha": "^8.0.3",
"@types/node": "^14.11.2",
"@types/yargs": "^15.0.7",
"@types/mocha": "^8.2.2",
"@types/node": "^14.14.37",
"@types/yargs": "^16.0.1",
"braces": "^3.0.2",
"chai": "^4.2.0",
"husky": "^4.3.0",
"lint-staged": "^10.4.0",
"mocha": "^8.1.3",
"prettier": "^2.1.2",
"chai": "^4.3.4",
"husky": "^6.0.0",
"lint-staged": "^10.5.4",
"mocha": "^10.1.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"ts-node": "^9.0.0",
"ts-node": "^9.1.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-eslint-rules": "^5.4.0",
"tslint-etc": "^1.13.7",
"typescript": "^4.0.3"
"tslint-etc": "^1.13.9",
"typescript": "^4.2.4"
},
"peerDependencies": {
"@angular/compiler": ">=8.0.0",
@@ -91,14 +91,14 @@
},
"dependencies": {
"@phenomnomnominal/tsquery": "^4.1.1",
"boxen": "^4.2.0",
"colorette": "^1.2.1",
"boxen": "^5.0.1",
"colorette": "^1.2.2",
"flat": "^5.0.2",
"gettext-parser": "^4.0.4",
"glob": "^7.1.6",
"mkdirp": "^1.0.4",
"path": "^0.12.7",
"terminal-link": "^2.1.1",
"yargs": "^16.0.3"
"yargs": "^16.2.0"
}
}
}

View File

@@ -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 [];
}

View File

@@ -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`]);
});
});