daniel-sc / ng-extract-i18n-merge

Extract and merge i18n xliff translation files for angular projects.
MIT License
170 stars 18 forks source link

Create missing output directories if not present #109

Open ctaepper opened 4 months ago

ctaepper commented 4 months ago

Is your feature request related to a problem? Please describe. for processing reasons, our output directory has the following structure

- src
  - locale
    - en-US/messages.xlf
    - en-GB/messages.xlf
    - de/messages.xlf

I am able to configure this output like this:

    "extract-i18n": {
      "executor": "ng-extract-i18n-merge:ng-extract-i18n-merge",
      "options": {
        "buildTarget": "web-login:build",
        ...
        "outputPath": "apps/web/login/src/locale/en-US",
        "targetFiles": [
          "../de/messages.xlf",
          "../en-GB/messages.xlf"
        ]
      }
    }

However, running this target will only work if the directories src/locale/(en-US|en-GB|de) are present. So I have to create those folders upfront, otherwise the executor will fail

I think it is somewhat related to #34 where targetfiles are created if missing. this feature request would now include also the creation of missing directories

daniel-sc commented 4 months ago

@ctaepper Thanks for this request! Would you like to make a PR for this?