Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to provide options to builderI18n #85

Open
phipla opened this issue Nov 16, 2023 · 2 comments
Open

Allow to provide options to builderI18n #85

phipla opened this issue Nov 16, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@phipla
Copy link

phipla commented Nov 16, 2023

Is your feature request related to a problem? Please describe.

We use ngx-build-plus to provide extra webpack config options to our Angular build. The relevant configuration below.

         "extract-i18n": {
             "executor": "ngx-build-plus:extract-i18n",
             "options": {
                 "browserTarget": "myapp:build",
                 "extraWebpackConfig": "tools/webpack-version.partial.js",
                 "outputPath": "src/locale"
             }
         },

We used to have a second phase using xliffmerge from https://github.com/martinroob/ngx-i18nsupport/tree/master/projects/xliffmerge . However, this project does not seem maintained anymore, and we would like to switch to ng-extract-i18n-merge.

The modified configuration is below. However, this configuration lacks the ability to pass the extraWebpackConfig option to the executor, and the build fails

        "extract-i18n": {
            "executor": "ng-extract-i18n-merge:ng-extract-i18n-merge",
            "options": {
                "browserTarget": "myapp:build",
                "builderI18n": "ngx-build-plus:extract-i18n",
                "format": "xlf",
                "outputPath": "src/locale",
                "targetFiles": [
                    "../../apps/myapp/src/locale/messages.en.xlf",
                    "../../apps/myapp/src/locale/messages.es.xlf",
                    "../../apps/myapp/src/locale/messages.de.xlf",
                    "../../apps/myapp/src/locale/messages.it.xlf"
                ],
                "sourceFile": "../../apps/myapp/src/locale/messages.xlf"
            }
        }

Describe the solution you'd like

Adding builderI18nOptions, if possible, would solve our problem:

        "extract-i18n": {
            "executor": "ng-extract-i18n-merge:ng-extract-i18n-merge",
            "options": {
                "browserTarget": "myapp:build",
                "builderI18n": "ngx-build-plus:extract-i18n",
                "builderI18nOptions": {
                    "extraWebpackConfig": "tools/webpack-version.partial.js"
                },
                // ...
            }
        }

Describe alternatives you've considered

Manually calling https://github.com/daniel-sc/xliff-simple-merge#readme for now

Additional context

@daniel-sc daniel-sc added the enhancement New feature or request label Nov 16, 2023
@daniel-sc
Copy link
Owner

@phipla thanks for this detailed request! I think this would be a meaningful addition. Would you like to make a PR for this?

@phipla
Copy link
Author

phipla commented Nov 17, 2023

Sure, I will try! It might take me a few weeks to find time to do so, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants