Commit Graph

140 Commits

Author SHA1 Message Date
Kim Biesbjerg
98b84447c7 refactor: use instanceof 2019-06-19 12:49:09 +02:00
Kim Biesbjerg
2507d0cdd2 gray -> dim 2019-06-19 12:42:28 +02:00
Kim Biesbjerg
69047857b2 Remove output 2019-06-19 12:39:54 +02:00
Kim Biesbjerg
04b6684024 Print more info when running extracttask 2019-06-19 12:37:50 +02:00
Kim Biesbjerg
9a8abb3248 refactor(directive parser) remove cheerio in favor of angular's own compiler 2019-06-18 15:54:58 +02:00
Kim Biesbjerg
c8ba1312b5 (refactor) remove extract marker function. will be published as a separate package at @biesbjerg/ngx-translate-extract-marker 2019-06-13 12:36:26 +02:00
Kim Biesbjerg
e0178b5a97 (bugfix) fix unmatched selector error when template didnt contain any html 2019-06-13 12:32:18 +02:00
Kim Biesbjerg
deb38eb7c3 (test) add test 2019-06-13 11:59:36 +02:00
Kim Biesbjerg
230b13e245 (refactor) rename processor to post processor 2019-06-13 11:44:04 +02:00
Kim Biesbjerg
4fd7efa2dc (refactor) simplify extraction of string literals 2019-06-13 11:23:37 +02:00
Kim Biesbjerg
02fc705bc0 (feat) add support for extracting binary expressions. example: translateService.instant(message || 'text if message is falsey') 2019-06-12 15:04:47 +02:00
Kim Biesbjerg
cb53f6f3b1 (fix) utils import path 2019-06-12 12:59:45 +02:00
Kim Biesbjerg
842b0a7d97 (fix) barrel import/export 2019-06-12 12:57:43 +02:00
Kim Biesbjerg
53eb4d1202 (refactor) get rid of AbstractTemplateParser 2019-06-12 11:50:23 +02:00
Kim Biesbjerg
102286a209 - (feat) add concept of post processors
- (feat) add 'key as default value' post processor (closes #109)
- (chore) move clean functionality to a post processor
- (chore) move sort functionality to a post processor
- (refactor) get rid of leading underscore on protected properties/methods
2019-06-11 23:06:47 +02:00
Kim Biesbjerg
ab29c9ab67 verbose disabled by default 2019-06-11 13:00:10 +02:00
Kim Biesbjerg
590f58fff3 (refactor) use object spread syntax 2019-06-11 12:54:50 +02:00
Kim Biesbjerg
d07d81681e update packages, replace chalk with colorette 2019-06-11 12:50:08 +02:00
Sean G. Wright
14eb09f947 feat(cli): add verbose (vb) flag that can control output of all file … (#74)
* feat(cli): add verbose (vb) flag that can control output of all file paths to console

* docs(README): add -vb description
2017-11-07 15:14:31 +01:00
Dominik Herbst
4892ea5146 Configured cheerio to work with non-HTML standard elements to fix issues with custom component tags. (#79) 2017-11-07 15:13:01 +01:00
Kim Biesbjerg
b2ae17697d Replace all occurences of escaped quotes. 2017-07-05 15:43:54 +02:00
Kim Biesbjerg
5259da8fe3 Add support for TranslateService's stream method. Closes #60 2017-07-05 15:18:41 +02:00
Kim Biesbjerg
4ee7258a31 Fix potential bug when extracting strings from file containing multiple classes 2017-05-10 14:10:13 +02:00
Kim Biesbjerg
d416c6b9fd Add support for extracting strings from multiple classes per file. Closes #46 2017-05-09 20:08:44 +02:00
Kim Biesbjerg
39a335638b Add support for parsing NamespacedJson in Json compiler. Closes #44 2017-05-09 14:39:39 +02:00
Kim Biesbjerg
3b9561916b Fix crash when constructor parameter has no type. Closes #38 2017-05-05 11:31:30 +02:00
Kim Biesbjerg
677d2a35ca Update dependencies. Bump version 2017-04-06 08:52:22 +02:00
cvaliere
262a89206d fix parser regexp (#31)
- fix template parser regexp (Closes #15)
2017-04-06 08:50:23 +02:00
Kim Biesbjerg
bcb4a9c069 Fix bug where obsolete strings were not removed when --clean was used. Closes #29 2017-03-31 08:31:14 +02:00
Kim Biesbjerg
5ad1fe6a18 Remove unused import 2017-03-31 08:21:28 +02:00
Kim Biesbjerg
030ab145d6 Add return types 2017-03-30 14:40:51 +02:00
Kim Biesbjerg
daaebede6f Add support for marker functions, to be able to extract strings not directly passed to TranslateService. Closes #10 2017-03-30 14:37:30 +02:00
Kim Biesbjerg
42a6568d47 Fix lint error 2017-03-29 14:20:35 +02:00
Kim Biesbjerg
9a2108e9a9 Add cli option to customize compiler indentation. Closes #22 2017-03-29 14:20:01 +02:00
Kim Biesbjerg
ff1c91010e Fix namespaced-json compiler not preserving numeric values. Fixes #28 2017-03-29 12:52:14 +02:00
Kim Biesbjerg
7b10b246e6 Update cli option descriptions. Change default filename to strings.format 2017-03-21 15:59:03 +01:00
Kim Biesbjerg
2f68bbc660 Fix package exports 2017-03-21 15:30:04 +01:00
Kim Biesbjerg
371a14d73e Read version directly from package.json 2017-03-21 15:27:24 +01:00
Kim Biesbjerg
4537c1224a Refactored Extractor and cli 2017-03-21 15:21:39 +01:00
Kim Biesbjerg
f61cdc4064 Rename cli script filename. Rename option 'dir' to 'input' 2017-03-20 15:51:38 +01:00
Kim Biesbjerg
3facc0c287 - Added typings for packages where typings existed
- Remove regexp ServiceParser and make AstServiceParser the default. #23
- Replaced CLI parser to add support for multiple input/output paths (supports file expansion, glob patterns and multiple values/parameters) #7
2017-03-20 15:29:41 +01:00
Kim Biesbjerg
c5d68cfcaa Check if parameter has a type before attempting to access. Should fix #26 2017-03-20 15:17:46 +01:00
Kim Biesbjerg
994c31fb97 Remove default compareFn. According to docs: If compareFunction is not supplied, elements are sorted by converting them to strings and comparing strings in Unicode code point order. 2017-03-07 15:49:25 +01:00
Kim Biesbjerg
f590b9bb9e Fix sorting. Closes #16 2017-03-07 15:45:50 +01:00
Kim Biesbjerg
d51674950c Update pinned package versions 2017-03-07 15:38:45 +01:00
Kim Biesbjerg
1c3915ff43 Add experimental AstServiceParser 2017-01-28 15:22:08 +01:00
Kim Biesbjerg
303fb1b6de Fix bug where keys were being extracted when not accessing TranslationService property 2017-01-28 15:06:05 +01:00
Kim Biesbjerg
fcd37fd000 Fix bug in PipeParser 2017-01-13 09:34:34 +01:00
Kim Biesbjerg
7822916e28 Add NamespacedJsonCompiler 2017-01-13 09:02:01 +01:00
Gustav Gahm
c18b7dc9c7 Add CLI option to enable alphabetical sorting of extracted keys 2017-01-13 06:05:52 +01:00
Kim Biesbjerg
94e6416c76 Small refactor 2016-12-23 05:54:49 +01:00
Kim Biesbjerg
5c78a37ae0 Add support for node 4.3.2+ 2016-12-23 05:45:06 +01:00
Kim Biesbjerg
031890c2a4 Allow --output to be either a directory or a full path including filename 2016-12-23 05:24:45 +01:00
Kim Biesbjerg
d786aa5f64 Explicitly define modules 2016-12-23 05:24:04 +01:00
Kim Biesbjerg
d0730431d0 Move normalizeTemplateAttributes method to DirectiveParser 2016-12-23 04:07:01 +01:00
Kim Biesbjerg
91dc1925a1 Fix export extractor 2016-12-23 04:06:30 +01:00
Kim Biesbjerg
9d87ff368c Fix Pipe regex and add test 2016-12-20 16:42:05 +01:00
Kim Biesbjerg
fbbfa04a34 Use non-greedy regular expression 2016-12-20 16:18:40 +01:00
Kim Biesbjerg
c88d387516 Update README and CLI output 2016-12-20 16:02:56 +01:00
Kim Biesbjerg
8093370e94 Add tests and allow more liberal spacing with get/instant calls 2016-12-13 15:17:03 +01:00
Kim Biesbjerg
2739545b9e Optimize TranslationCollection 2016-12-10 19:20:44 +01:00
Kim Biesbjerg
43df1f0fb8 Fix bug in DirectiveParser: should not extract translate pipe in html tag 2016-12-10 04:14:13 +01:00
Kim Biesbjerg
4307e4bde8 Fix: no implicit any 2016-12-10 04:13:36 +01:00
Kim Biesbjerg
dca10f23de Group utils import 2016-12-10 04:13:18 +01:00
Kim Biesbjerg
3bb74e6c9e Move extractor to utils 2016-12-10 03:40:07 +01:00
Kim Biesbjerg
2ec4fd194f Export classes in a barrel 2016-12-10 03:37:05 +01:00
Kim Biesbjerg
657eb6d953 Change cli description for output 2016-12-10 03:36:28 +01:00
Kim Biesbjerg
6b2059b23e Move cli code to Typescript 2016-12-10 03:29:03 +01:00
Kim Biesbjerg
a7e0a9d909 Refactor cli and move responsibilities out of Extractor 2016-12-10 01:57:20 +01:00
Kim Biesbjerg
c9bae68a84 Use domain property 2016-12-10 01:56:45 +01:00
Kim Biesbjerg
6a76e7b5cb Add option to merge extracted strings with existing translations (Thanks to @ocombe) 2016-12-09 19:29:48 +01:00
Kim Biesbjerg
59ef277c64 Refactor and clean code 2016-12-09 14:40:21 +01:00
Kim Biesbjerg
73801a9cc5 Add StringCollection to make it easier to work with strings 2016-12-09 05:18:04 +01:00
Kim Biesbjerg
e5f937d7f6 Support alternate ng2-translate attribute in DirectiveParser. Add more tests 2016-12-08 16:09:06 +01:00
Kim Biesbjerg
3601b5985b Make regexes more readable by not creating from string 2016-12-08 15:27:44 +01:00
Kim Biesbjerg
fdf26d6af5 Add support for extracting array of strings in ServiceParser + tests 2016-12-08 15:24:23 +01:00
Kim Biesbjerg
23d2a5eb9d Add tests for AbstractTemplateParser and DirectiveParser 2016-12-08 13:53:13 +01:00
Kim Biesbjerg
2c3b5e580d Extract direct text nodes only when parsing directive 2016-12-07 16:30:24 +01:00
Kim Biesbjerg
e26d522604 Grab html instead of text when parsing directive 2016-12-07 16:03:46 +01:00
Kim Biesbjerg
e56ce36d9d Include tslint.json 2016-12-07 15:27:48 +01:00
Kim Biesbjerg
e6b03f8582 Fix regex. Add *.js to globPatterns 2016-12-07 12:38:16 +01:00
Kim Biesbjerg
cf93eeebf8 Trim whitespace 2016-12-07 06:31:05 +01:00
Kim Biesbjerg
7ca714f029 Formatting 2016-12-07 06:16:18 +01:00
Kim Biesbjerg
f4b5dbed24 Move _normalizeTemplateAttributes to AbstractTemplateParser 2016-12-07 06:14:50 +01:00
Kim Biesbjerg
1ee298f737 Refactor code. Add DirectiveParser (Thanks ocombe\!) 2016-12-07 06:10:48 +01:00
Olivier Combe
24214729c1 Adding a directive parser, and refactoring code a bit 2016-12-06 18:43:21 +01:00
Kim Biesbjerg
6aeb0a69ad Renamed test.ts to example.ts and changed it to fit new interface 2016-12-04 22:57:52 +01:00
Kim Biesbjerg
74fd853097 Move glob patterns to extractor 2016-12-04 22:53:59 +01:00
Kim Biesbjerg
25760bab5b Fix template regex to match translate pipe usage in input properties 2016-12-03 15:20:56 +01:00
Kim Biesbjerg
b5e1125efb Initial commit 2016-12-03 15:09:39 +01:00