Transloco: Support for i18n files per library containing re-usable components in a monorepo with multiple SPAs

Created on 28 Nov 2019  路  1Comment  路  Source: ngneat/transloco

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

This is a continuation of issue: https://github.com/ngneat/transloco/issues/159.

I have a monorepo with multiple SPAs and I am not sure what my transloco.config.js should look like. I want to copy those library translation packs that are needed for each SPA and not sure how to do that with rootTranslationsPath.

module.exports = {
  rootTranslationsPath: 'src/assets/i18n',
  scopedLibs: [
    './projects/engine-lib/', 'engine-lib'
  ]
};

Most helpful comment

Hi @bjornharvold thanks for opening this issue,

I have added an option for multi destinations support...
This is the way to do it:

transloco.config.js:

module.exports = {
  ...
  scopedLibs: [{
    src: './projects/side-lib',
    dist: ['./projects/spa/src/assets/i18n', './src/assets/i18n/']
  }]
};

>All comments

Hi @bjornharvold thanks for opening this issue,

I have added an option for multi destinations support...
This is the way to do it:

transloco.config.js:

module.exports = {
  ...
  scopedLibs: [{
    src: './projects/side-lib',
    dist: ['./projects/spa/src/assets/i18n', './src/assets/i18n/']
  }]
};
Was this page helpful?
0 / 5 - 0 ratings