@@ -54,7 +54,7 @@ const listDir = (dir, pattern) => {
5454 let results = [ ] ;
5555 const list = fs . readdirSync ( dir ) ;
5656 list . forEach ( ( file ) => {
57- if ( file === 'node_modules' ) {
57+ if ( file === 'node_modules' || file === 'dist' ) {
5858 return ;
5959 }
6060 const path = dir + '/' + file ;
@@ -91,8 +91,10 @@ const updateTsConfig = (topdir, tsconfig, collectedMsgIds = null) => {
9191 return msgIds ;
9292} ;
9393
94- // Determine workspaces
95- const workspaces = readJSON ( '/package.json' ) . workspaces || [ ] ;
94+ // Determine workspaces / dependencies
95+ const packageJson = readJSON ( '/package.json' ) ;
96+ const workspaces = packageJson . workspaces || [ ] ;
97+ const qwcDeps = Object . keys ( packageJson . dependencies ?? { qwc2 : "0" } ) . filter ( dep => dep . startsWith ( "qwc" ) ) ;
9698
9799// Generate workspace translations
98100let collectedMsgIds = new Set ( ) ;
@@ -143,6 +145,10 @@ for (const lang of config.languages || []) {
143145 for ( const workspace of workspaces ) {
144146 data = merge ( data , readJSON ( '/' + workspace + '/static/translations/' + lang + '.json' ) ) ;
145147 }
148+ // Merge translations from dependencies
149+ for ( const qwcDep of qwcDeps ) {
150+ data = merge ( data , readJSON ( '/node_modules/' + qwcDep + '/static/translations/' + lang + '.json' ) ) ;
151+ }
146152
147153 // Revert to original values for strings specified in overrides
148154 for ( const path of config . overrides || [ ] ) {
0 commit comments