ngx-translate-extract icon indicating copy to clipboard operation
ngx-translate-extract copied to clipboard

brace expansion doesn't work

Open Smoorfy opened this issue 4 years ago • 6 comments

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!

Smoorfy avatar Jun 10 '20 17:06 Smoorfy

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.

KrzysztofProgrammer avatar Jun 12 '20 08:06 KrzysztofProgrammer

Thank you for testing

How could this be resolved on windows?

Smoorfy avatar Jun 12 '20 10:06 Smoorfy

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.

KrzysztofProgrammer avatar Jun 18 '20 19:06 KrzysztofProgrammer

I can confirm the same issue on my project using

"@biesbjerg/ngx-translate-extract": "^7.0.2",
"typescript": "~3.7.5"

BenDevelopment avatar Aug 06 '20 13:08 BenDevelopment

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"

BenDevelopment avatar Aug 06 '20 13:08 BenDevelopment