ngx-translate-extract
ngx-translate-extract copied to clipboard
brace expansion doesn't work
Hi,
i'm trying to use this script
"i18n:extract": "ngx-translate-extract --input ./src --output ./src/assets/i18n/{it,en}.json --clean --format json"
it creates src\assets\i18n{it,en}.json file instead of 2 files
the problem may be in this function
export function expandPattern(pattern: string): string[] { return braces(pattern, { expand: true, keepEscaping: true }); }
could you check please
Thank you!
In my project problem occured on Windows, node 12.16.1, Tested ngx-translate-extract on version 7.0.0 and 6.1.0 - problem found.
On Linux is working well.
Thank you for testing
How could this be resolved on windows?
I can't resolve this problem. So, I make workaround in package.json scripts section:
"i18n:pl": "ngx-translate-extract --input ./src --output ./src/assets/i18n/pl.json --format json --sort",
"i18n:en": "ngx-translate-extract --input ./src --output ./src/assets/i18n/en.json --format json --sort"
"i18n:de": "ngx-translate-extract --input ./src --output ./src/assets/i18n/de.json --format json --sort"
after that you can create "i18n:all": that runs all script one after another.
I can confirm the same issue on my project using
"@biesbjerg/ngx-translate-extract": "^7.0.2",
"typescript": "~3.7.5"
I can't resolve this problem. So, I make workaround in package.json scripts section:
"i18n:pl": "ngx-translate-extract --input ./src --output ./src/assets/i18n/pl.json --format json --sort", "i18n:en": "ngx-translate-extract --input ./src --output ./src/assets/i18n/en.json --format json --sort" "i18n:de": "ngx-translate-extract --input ./src --output ./src/assets/i18n/de.json --format json --sort"
after that you can create "i18n:all": that runs all script one after another.
You can group paths on the same line:
"i18n": "ngx-translate-extract --input ./src --output ./src/assets/i18n/pl.json ./src/assets/i18n/en.json ./src/assets/i18n/de.json --format json --sort"