biesbjerg / ngx-translate-extract

Extract translatable (using ngx-translate) strings and save as a JSON or Gettext pot file
MIT License
525 stars 198 forks source link

How to convert LF extracted file to CRLF? #84

Open 51Ray opened 6 years ago

51Ray commented 6 years ago

How to convert LF extracted JSON file to CRLF? I run the script without changing translation keys, git show this message: image

sergiubologa commented 5 years ago

Hey @51Ray! Have you found any solution to this?

sergiubologa commented 5 years ago

Seems like the issue is here: https://github.com/biesbjerg/ngx-translate-extract/blob/master/src/compilers/json.compiler.ts#L20

The JSON compilers are using JSON.stringify to parse objects to string and save that string into translation files.

biesbjerg commented 5 years ago

I'm not sure I follow? What does this have to do with LF vs CRLF?

The timestamp of the file is updated because it's saved to disk, and since you didn't add/remove any keys in the files you scan, the contents remain the same, like your git UI client states.