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

Feature: clearer instructions on how to add to a Nx workspace #168

Open
1 task done
mackelito opened this issue Oct 13, 2023 · 0 comments
Open
1 task done

Feature: clearer instructions on how to add to a Nx workspace #168

mackelito opened this issue Oct 13, 2023 · 0 comments

Comments

@mackelito
Copy link

mackelito commented Oct 13, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe

In our workspace we have 5 apps and they use feature libraries only (the apps only have 1 component app.component.ts) the rest is features loaded via the app routes.

I would like to have a clear way of extracting all keys and generate a folder that contains the translation files.
A neat feature would be if it could generate a file for each lang that is defined in the loader used for the feature.

Example:
in my lib.routes.ts

export const loader = ['en', 'sv'].reduce((acc, lang) => {
  acc[lang] = () => import(`./i18n/${lang}.json`);
  return acc;
}, {});

providers: [
  provideTranslocoScope({
    scope: ' ', // This needs to be emtpy to not require a prefix in the template
    loader,
  }),
],

Describe the solution you'd like

either we could use the Nx "extract-i18n" target by adding something like this:

      "extract-i18n": {
        "executor": "nx:run-commands",
        "options": {
          "commands": ["npx transloco-keys-manager extract --project my-nice-feature"]
        }
      }

Or even better would to have it generate automatically when adding a new translation string. (eg. adding t('my-string-to-translate´) in a template) Not sure how but perhaps using webpack/esbuild?

Describe alternatives you've considered

No response

Describe alternatives you've considered

using angulars own i18n

Describe alternatives you've considered

using angulars own i18n

Additional context

No response

I would like to make a pull request for this feature

No

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

No branches or pull requests

1 participant