From 9db047f8fcc7895561d7c804942f94a2f22f5be5 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Fri, 2 Jun 2017 09:17:08 +0100 Subject: [PATCH] [ADF-721] Fix translation reference for dev task (#1923) * move translation files in the bundles folder * fix after review ripristinate tslint and remove override tsconfig --- demo-shell-ng2/config/webpack.common.js | 7 --- demo-shell-ng2/config/webpack.prod.js | 8 ++++ ng2-components/config/webpack.common.js | 46 +++++++++++++++---- .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../analytics-generator.component.ts | 2 +- .../analytics-report-heat-map.component.ts | 2 +- .../analytics-report-parameters.component.ts | 2 +- .../src/components/analytics.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../src/components/diagram.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../components/activiti-content.component.ts | 2 +- .../activiti-start-form.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../components/activiti-filters.component.ts | 2 +- .../activiti-process-comments.component.ts | 2 +- ...viti-process-instance-details.component.ts | 2 +- ...iviti-process-instance-header.component.ts | 2 +- ...tiviti-process-instance-tasks.component.ts | 2 +- ...ti-process-instance-variables.component.ts | 2 +- .../activiti-processlist.component.ts | 2 +- .../activiti-start-process.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../src/components/activiti-apps.component.ts | 2 +- .../activiti-checklist.component.ts | 2 +- .../components/activiti-comments.component.ts | 2 +- .../components/activiti-filters.component.ts | 2 +- .../activiti-people-search.component.ts | 2 +- .../components/activiti-people.component.ts | 2 +- .../activiti-start-task.component.ts | 2 +- .../activiti-task-details.component.ts | 2 +- .../activiti-task-header.component.ts | 2 +- .../components/activiti-tasklist.component.ts | 2 +- .../adf-task-attachment-list.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../ng2-alfresco-core/src/i18n/en.json | 3 ++ .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../ng2-alfresco-datatable/src/i18n/en.json | 3 ++ .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../src/components/document-list.component.ts | 2 +- .../document-menu-action.component.ts | 2 +- .../services/document-actions.service.spec.ts | 2 +- .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../components/alfresco-login.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- ...esco-search-autocomplete.component.spec.ts | 2 +- .../alfresco-search-autocomplete.component.ts | 2 +- .../alfresco-search-control.component.spec.ts | 2 +- .../alfresco-search-control.component.ts | 2 +- .../alfresco-search.component.spec.ts | 2 +- .../components/alfresco-search.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../ng2-alfresco-social/src/i18n/en.json | 3 ++ .../ng2-alfresco-tag/config/webpack.common.js | 6 +++ .../demo/config/webpack.common.js | 9 +--- .../src/components/tag-actions.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../file-uploading-dialog.component.ts | 2 +- .../src/components/upload-button.component.ts | 2 +- .../components/upload-drag-area.component.ts | 2 +- .../config/webpack.common.js | 6 +++ .../src/components/user-info.component.ts | 2 +- .../config/webpack.common.js | 8 +++- .../ng2-alfresco-viewer/src/i18n/en.json | 3 ++ .../config/webpack.common.js | 6 +++ .../ng2-alfresco-webscript/src/i18n/en.json | 3 ++ ng2-components/tsconfig.json | 38 +++++++++++++++ 77 files changed, 247 insertions(+), 146 deletions(-) create mode 100644 ng2-components/ng2-alfresco-core/src/i18n/en.json create mode 100644 ng2-components/ng2-alfresco-datatable/src/i18n/en.json create mode 100644 ng2-components/ng2-alfresco-social/src/i18n/en.json create mode 100644 ng2-components/ng2-alfresco-viewer/src/i18n/en.json create mode 100644 ng2-components/ng2-alfresco-webscript/src/i18n/en.json create mode 100644 ng2-components/tsconfig.json diff --git a/demo-shell-ng2/config/webpack.common.js b/demo-shell-ng2/config/webpack.common.js index f9c908d028..103e7ebfcf 100644 --- a/demo-shell-ng2/config/webpack.common.js +++ b/demo-shell-ng2/config/webpack.common.js @@ -126,13 +126,6 @@ module.exports = { from: '**/*.json', to: 'resources/i18n' }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }), { from: 'favicon-96x96.png' }, diff --git a/demo-shell-ng2/config/webpack.prod.js b/demo-shell-ng2/config/webpack.prod.js index 68926bf13a..554b266474 100644 --- a/demo-shell-ng2/config/webpack.prod.js +++ b/demo-shell-ng2/config/webpack.prod.js @@ -58,6 +58,14 @@ module.exports = webpackMerge(commonConfig, { plugins: [ new CopyWebpackPlugin([ + //Deprecation old files translation strategy from 1.6.0 translation files are in the bundles folder + ... alfrescoLibs.map(lib => { + return { + context: 'node_modules', + from: `${lib}/src/i18n/*`, + to: `assets/${lib}/i18n/*` + } + }), ... alfrescoLibs.map(lib => { return { context: `node_modules/${lib}/bundles/assets/` , diff --git a/ng2-components/config/webpack.common.js b/ng2-components/config/webpack.common.js index 6bac7a59d0..68f9f8024a 100644 --- a/ng2-components/config/webpack.common.js +++ b/ng2-components/config/webpack.common.js @@ -2,6 +2,26 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); + +const alfrescoLibs = [ + 'ng2-activiti-analytics', + 'ng2-activiti-diagrams', + 'ng2-activiti-form', + 'ng2-activiti-processlist', + 'ng2-activiti-tasklist', + 'ng2-alfresco-core', + 'ng2-alfresco-datatable', + 'ng2-alfresco-documentlist', + 'ng2-alfresco-login', + 'ng2-alfresco-search', + 'ng2-alfresco-social', + 'ng2-alfresco-tag', + 'ng2-alfresco-upload', + 'ng2-alfresco-userinfo', + 'ng2-alfresco-viewer', + 'ng2-alfresco-webscript' +]; module.exports = { @@ -50,7 +70,7 @@ module.exports = { test: /\.ts$/, loader: 'tslint-loader', options: { - emitErrors: true, + emitErrors: false, configFile: path.resolve(__dirname, './assets/tslint.json') }, exclude: [/node_modules/, /bundles/, /dist/, /demo/] @@ -58,10 +78,9 @@ module.exports = { { test: /\.ts$/, use: ['ts-loader?' + JSON.stringify({ - "compilerOptions": { - "typeRoots": [ - "../node_modules/@types" - ]} + "logInfoToStdOut": true, + "logLevel": "error", + "configFileName": path.resolve(__dirname, '../tsconfig.json') }), 'angular2-template-loader'], exclude: [/node_modules/, /bundles/, /dist/, /demo/] }, @@ -87,7 +106,7 @@ module.exports = { emitErrors: true, licenseFile: path.resolve(__dirname, './assets/license_header.txt') }, - exclude: [/node_modules/, /bundles/, /dist/, /demo/, /rendering-queue.services.ts/], + exclude: [/node_modules/, /bundles/, /dist/, /demo/, /rendering-queue.services.ts/] }, { test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, @@ -112,8 +131,8 @@ module.exports = { "ng2-alfresco-core": path.resolve(__dirname, '../ng2-alfresco-core/index.ts'), "ng2-alfresco-datatable": path.resolve(__dirname, '../ng2-alfresco-datatable/index.ts'), "ng2-activiti-diagrams": path.resolve(__dirname, '../ng2-activiti-diagrams/index.ts'), - "ng2-activiti-analytics":path.resolve(__dirname, '../ng2-activiti-analytics/index.ts'), - "ng2-activiti-form":path.resolve(__dirname, '../ng2-activiti-form/index.ts'), + "ng2-activiti-analytics": path.resolve(__dirname, '../ng2-activiti-analytics/index.ts'), + "ng2-activiti-form": path.resolve(__dirname, '../ng2-activiti-form/index.ts'), "ng2-activiti-tasklist": path.resolve(__dirname, '../ng2-activiti-tasklist/index.ts'), "ng2-activiti-processlist": path.resolve(__dirname, '../ng2-activiti-processlist/index.ts'), "ng2-alfresco-documentlist": path.resolve(__dirname, '../ng2-alfresco-documentlist/index.ts'), @@ -127,10 +146,19 @@ module.exports = { "ng2-alfresco-userinfo": path.resolve(__dirname, '../ng2-alfresco-userinfo/index.ts') }, extensions: ['.ts', '.js'], - modules: [helpers.root('node_modules')] + modules: [helpers.root('node_modules')] }, plugins: [ + new CopyWebpackPlugin([ + ... alfrescoLibs.map(lib => { + return { + from: `${lib}/src/i18n/`, + to: `${lib}/bundles/assets/${lib}/i18n/` + } + }) + ]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-activiti-analytics/config/webpack.common.js b/ng2-components/ng2-activiti-analytics/config/webpack.common.js index b9614b724c..5ba42d9fa8 100644 --- a/ng2-components/ng2-activiti-analytics/config/webpack.common.js +++ b/ng2-components/ng2-activiti-analytics/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-activiti-analytics/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-activiti-analytics/demo/config/webpack.common.js b/ng2-components/ng2-activiti-analytics/demo/config/webpack.common.js index a58f62ff50..5dc3e39236 100644 --- a/ng2-components/ng2-activiti-analytics/demo/config/webpack.common.js +++ b/ng2-components/ng2-activiti-analytics/demo/config/webpack.common.js @@ -104,14 +104,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-generator.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics-generator.component.ts index bfa909419d..dec0e96d30 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics-generator.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-generator.component.ts @@ -67,7 +67,7 @@ export class AnalyticsGeneratorComponent implements OnChanges { private logService: LogService) { logService.info('AnalyticsGeneratorComponent'); if (translateService) { - translateService.addTranslationFolder('ng2-activiti-analytics', 'node_modules/ng2-activiti-analytics/src'); + translateService.addTranslationFolder('ng2-activiti-analytics', 'assets/ng2-activiti-analytics'); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts index 19542e41fe..6f12af7111 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts @@ -46,7 +46,7 @@ export class AnalyticsReportHeatMapComponent implements OnInit { private analyticsService: AnalyticsService, private formBuilder: FormBuilder) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-analytics', 'node_modules/ng2-activiti-analytics/src'); + translateService.addTranslationFolder('ng2-activiti-analytics', 'assets/ng2-activiti-analytics'); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.ts index 51609586e2..be378cb73b 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.ts @@ -110,7 +110,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On private logService: LogService, private contentService: ContentService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-analytics', 'node_modules/ng2-activiti-analytics/src'); + translateService.addTranslationFolder('ng2-activiti-analytics', 'assets/ng2-activiti-analytics'); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts index b32136e2d4..4e9b503859 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts @@ -59,7 +59,7 @@ export class AnalyticsComponent implements OnChanges { private logService: LogService) { logService.info('AnalyticsComponent'); if (translateService) { - translateService.addTranslationFolder('ng2-activiti-analytics', 'node_modules/ng2-activiti-analytics/src'); + translateService.addTranslationFolder('ng2-activiti-analytics', 'assets/ng2-activiti-analytics'); } } diff --git a/ng2-components/ng2-activiti-diagrams/config/webpack.common.js b/ng2-components/ng2-activiti-diagrams/config/webpack.common.js index b9614b724c..9a254aa9e1 100644 --- a/ng2-components/ng2-activiti-diagrams/config/webpack.common.js +++ b/ng2-components/ng2-activiti-diagrams/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-activiti-diagrams/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-activiti-diagrams/demo/config/webpack.common.js b/ng2-components/ng2-activiti-diagrams/demo/config/webpack.common.js index c51e7424e5..dde638e841 100644 --- a/ng2-components/ng2-activiti-diagrams/demo/config/webpack.common.js +++ b/ng2-components/ng2-activiti-diagrams/demo/config/webpack.common.js @@ -103,14 +103,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts index b22e99e270..e91c2048de 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts @@ -67,7 +67,7 @@ export class DiagramComponent { private diagramsService: DiagramsService, private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-diagrams', 'node_modules/ng2-activiti-diagrams/src'); + translateService.addTranslationFolder('ng2-activiti-diagrams', 'assets/ng2-activiti-diagrams'); } } diff --git a/ng2-components/ng2-activiti-form/config/webpack.common.js b/ng2-components/ng2-activiti-form/config/webpack.common.js index b9614b724c..e847288a15 100644 --- a/ng2-components/ng2-activiti-form/config/webpack.common.js +++ b/ng2-components/ng2-activiti-form/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-activiti-form/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-activiti-form/demo/config/webpack.common.js b/ng2-components/ng2-activiti-form/demo/config/webpack.common.js index 5a6dcbd682..d73d10d9f0 100644 --- a/ng2-components/ng2-activiti-form/demo/config/webpack.common.js +++ b/ng2-components/ng2-activiti-form/demo/config/webpack.common.js @@ -103,14 +103,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-activiti-form/src/components/activiti-content.component.ts b/ng2-components/ng2-activiti-form/src/components/activiti-content.component.ts index cc7516136e..2e6b18727a 100644 --- a/ng2-components/ng2-activiti-form/src/components/activiti-content.component.ts +++ b/ng2-components/ng2-activiti-form/src/components/activiti-content.component.ts @@ -53,7 +53,7 @@ export class ActivitiContent implements OnChanges { private logService: LogService, private contentService: ContentService) { if (this.translate) { - this.translate.addTranslationFolder('ng2-activiti-form', 'node_modules/ng2-activiti-form/src'); + this.translate.addTranslationFolder('ng2-activiti-form', 'assets/ng2-activiti-form'); } } diff --git a/ng2-components/ng2-activiti-form/src/components/activiti-start-form.component.ts b/ng2-components/ng2-activiti-form/src/components/activiti-start-form.component.ts index af36437238..de2c3e5d0d 100644 --- a/ng2-components/ng2-activiti-form/src/components/activiti-start-form.component.ts +++ b/ng2-components/ng2-activiti-form/src/components/activiti-start-form.component.ts @@ -88,7 +88,7 @@ export class ActivitiStartForm extends ActivitiForm implements AfterViewChecked, super(formService, visibilityService, null, null, logService); if (this.translate) { - this.translate.addTranslationFolder('ng2-activiti-form', 'node_modules/ng2-activiti-form/src'); + this.translate.addTranslationFolder('ng2-activiti-form', 'assets/ng2-activiti-form'); } this.showTitle = false; diff --git a/ng2-components/ng2-activiti-processlist/config/webpack.common.js b/ng2-components/ng2-activiti-processlist/config/webpack.common.js index b9614b724c..6da7176213 100644 --- a/ng2-components/ng2-activiti-processlist/config/webpack.common.js +++ b/ng2-components/ng2-activiti-processlist/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-activiti-processlist/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-activiti-processlist/demo/config/webpack.common.js b/ng2-components/ng2-activiti-processlist/demo/config/webpack.common.js index 43cc210237..681f8543d0 100644 --- a/ng2-components/ng2-activiti-processlist/demo/config/webpack.common.js +++ b/ng2-components/ng2-activiti-processlist/demo/config/webpack.common.js @@ -106,14 +106,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-filters.component.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-filters.component.ts index e9d183b91a..76b1a2b902 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-filters.component.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-filters.component.ts @@ -61,7 +61,7 @@ export class ActivitiProcessFilters implements OnInit, OnChanges { this.filter$ = new Observable(observer => this.filterObserver = observer).share(); if (translate) { - translate.addTranslationFolder('ng2-activiti-processlist', 'node_modules/ng2-activiti-processlist/src'); + translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist'); } } diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-comments.component.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-comments.component.ts index 17449f34c3..85e97405ee 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-comments.component.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-comments.component.ts @@ -59,7 +59,7 @@ export class ActivitiProcessComments implements OnChanges { private activitiProcess: ActivitiProcessService) { if (translate) { - translate.addTranslationFolder('ng2-activiti-processlist', 'node_modules/ng2-activiti-processlist/src'); + translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist'); } this.comment$ = new Observable(observer => this.commentObserver = observer).share(); diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-details.component.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-details.component.ts index 5b2e1e4097..4ac62eb633 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-details.component.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-details.component.ts @@ -71,7 +71,7 @@ export class ActivitiProcessInstanceDetails implements OnChanges { private logService: LogService) { if (translate) { - translate.addTranslationFolder('ng2-activiti-processlist', 'node_modules/ng2-activiti-processlist/src'); + translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist'); } } diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-header.component.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-header.component.ts index 811834a304..8f7ce0b23c 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-header.component.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-header.component.ts @@ -45,7 +45,7 @@ export class ActivitiProcessInstanceHeader { private logService: LogService) { if (translate) { - translate.addTranslationFolder('ng2-activiti-processlist', 'node_modules/ng2-activiti-processlist/src'); + translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist'); } } diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-tasks.component.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-tasks.component.ts index c5e9d12de6..adfa62a7d0 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-tasks.component.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-tasks.component.ts @@ -70,7 +70,7 @@ export class ActivitiProcessInstanceTasks implements OnInit, OnChanges { private activitiProcess: ActivitiProcessService, private logService: LogService) { if (translate) { - translate.addTranslationFolder('ng2-activiti-processlist', 'node_modules/ng2-activiti-processlist/src'); + translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist'); } this.task$ = new Observable(observer => this.taskObserver = observer).share(); diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-variables.component.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-variables.component.ts index ed8f578e20..dad7269fbf 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-variables.component.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-variables.component.ts @@ -70,7 +70,7 @@ export class ActivitiProcessInstanceVariables implements OnInit, OnChanges { private activitiProcess: ActivitiProcessService) { if (translate) { - translate.addTranslationFolder('ng2-activiti-processlist', 'node_modules/ng2-activiti-processlist/src'); + translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist'); } } diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-processlist.component.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-processlist.component.ts index fbc0ab7704..7ce260bc08 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-processlist.component.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-processlist.component.ts @@ -71,7 +71,7 @@ export class ActivitiProcessInstanceListComponent implements OnChanges, AfterCon constructor(private processService: ActivitiProcessService, private translate: AlfrescoTranslationService) { if (translate !== null) { - translate.addTranslationFolder('ng2-activiti-processlist', 'node_modules/ng2-activiti-processlist/src'); + translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist'); } } diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-start-process.component.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-start-process.component.ts index b9a051ce6e..6c49d088c8 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-start-process.component.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-start-process.component.ts @@ -60,7 +60,7 @@ export class ActivitiStartProcessInstance implements OnChanges { private activitiProcess: ActivitiProcessService) { if (translate) { - translate.addTranslationFolder('ng2-activiti-processlist', 'node_modules/ng2-activiti-processlist/src'); + translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist'); } } diff --git a/ng2-components/ng2-activiti-tasklist/config/webpack.common.js b/ng2-components/ng2-activiti-tasklist/config/webpack.common.js index b9614b724c..e8ce498511 100644 --- a/ng2-components/ng2-activiti-tasklist/config/webpack.common.js +++ b/ng2-components/ng2-activiti-tasklist/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-activiti-tasklist/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-activiti-tasklist/demo/config/webpack.common.js b/ng2-components/ng2-activiti-tasklist/demo/config/webpack.common.js index fa4dd56996..807cf6f51b 100644 --- a/ng2-components/ng2-activiti-tasklist/demo/config/webpack.common.js +++ b/ng2-components/ng2-activiti-tasklist/demo/config/webpack.common.js @@ -104,14 +104,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-apps.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-apps.component.ts index 88a367b323..04a5a5ca55 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-apps.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-apps.component.ts @@ -71,7 +71,7 @@ export class ActivitiApps implements OnInit { private activitiTaskList: ActivitiTaskListService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } this.apps$ = new Observable(observer => this.appsObserver = observer).share(); diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-checklist.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-checklist.component.ts index 8ddfa2430f..1e6ded3b2e 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-checklist.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-checklist.component.ts @@ -69,7 +69,7 @@ export class ActivitiChecklist implements OnInit, OnChanges { private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } this.task$ = new Observable(observer => this.taskObserver = observer).share(); } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts index 2f2256d0f7..4adcc7307d 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts @@ -59,7 +59,7 @@ export class ActivitiComments implements OnChanges { private activitiTaskList: ActivitiTaskListService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } this.comment$ = new Observable(observer => this.commentObserver = observer).share(); diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.component.ts index a5898262ad..13b6c311e4 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.component.ts @@ -62,7 +62,7 @@ export class ActivitiFilters implements OnInit, OnChanges { this.filter$ = new Observable(observer => this.filterObserver = observer).share(); if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people-search.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people-search.component.ts index 077cad8a2b..2a4b5a33bf 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people-search.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people-search.component.ts @@ -49,7 +49,7 @@ export class ActivitiPeopleSearch implements OnInit, AfterViewInit { constructor(private translateService: AlfrescoTranslationService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } this.searchUser diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts index 3b93f7e1f0..d541a07f4a 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts @@ -60,7 +60,7 @@ export class ActivitiPeople { private peopleService: ActivitiPeopleService, private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } this.peopleSearch$ = new Observable(observer => this.peopleSearchObserver = observer).share(); } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-start-task.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-start-task.component.ts index 673f0f449a..b0ce48875e 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-start-task.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-start-task.component.ts @@ -60,7 +60,7 @@ export class ActivitiStartTaskButton { private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts index 131d3554a2..fda3c2b230 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts @@ -125,7 +125,7 @@ export class ActivitiTaskDetails implements OnInit, OnChanges { private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.ts index 4a48b82f84..b8e8a6dbbb 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.ts @@ -40,7 +40,7 @@ export class ActivitiTaskHeader { private activitiTaskService: ActivitiTaskListService, private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts index c97565afd2..3a8e04e020 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts @@ -101,7 +101,7 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit { private taskListService: ActivitiTaskListService, private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } } diff --git a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.ts index 108a3f6f69..66f827cf35 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.ts @@ -45,7 +45,7 @@ export class TaskAttachmentListComponent implements OnChanges { private contentService: ContentService) { if (translateService) { - translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src'); + translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist'); } } diff --git a/ng2-components/ng2-alfresco-core/config/webpack.common.js b/ng2-components/ng2-alfresco-core/config/webpack.common.js index b9614b724c..1d839c53a6 100644 --- a/ng2-components/ng2-alfresco-core/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-core/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-core/src/i18n/en.json b/ng2-components/ng2-alfresco-core/src/i18n/en.json new file mode 100644 index 0000000000..0db3279e44 --- /dev/null +++ b/ng2-components/ng2-alfresco-core/src/i18n/en.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/ng2-components/ng2-alfresco-datatable/config/webpack.common.js b/ng2-components/ng2-alfresco-datatable/config/webpack.common.js index b9614b724c..071ae92cce 100644 --- a/ng2-components/ng2-alfresco-datatable/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-datatable/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-datatable/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-datatable/demo/config/webpack.common.js b/ng2-components/ng2-alfresco-datatable/demo/config/webpack.common.js index c0b8ee56bf..cbbe32e7c6 100644 --- a/ng2-components/ng2-alfresco-datatable/demo/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-datatable/demo/config/webpack.common.js @@ -103,14 +103,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-alfresco-datatable/src/i18n/en.json b/ng2-components/ng2-alfresco-datatable/src/i18n/en.json new file mode 100644 index 0000000000..0db3279e44 --- /dev/null +++ b/ng2-components/ng2-alfresco-datatable/src/i18n/en.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/ng2-components/ng2-alfresco-documentlist/config/webpack.common.js b/ng2-components/ng2-alfresco-documentlist/config/webpack.common.js index b9614b724c..08fac2139c 100644 --- a/ng2-components/ng2-alfresco-documentlist/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-documentlist/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-documentlist/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-documentlist/demo/config/webpack.common.js b/ng2-components/ng2-alfresco-documentlist/demo/config/webpack.common.js index 8f78b2736b..ccf0233e13 100644 --- a/ng2-components/ng2-alfresco-documentlist/demo/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-documentlist/demo/config/webpack.common.js @@ -104,14 +104,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.ts index 0186759aaf..948a1bc9bf 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.ts @@ -167,7 +167,7 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni private el: ElementRef) { if (translateService) { - translateService.addTranslationFolder('ng2-alfresco-documentlist', 'node_modules/ng2-alfresco-documentlist/src'); + translateService.addTranslationFolder('ng2-alfresco-documentlist', 'assets/ng2-alfresco-documentlist'); } } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.component.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.component.ts index 6f36f4ecf0..b42ee4e572 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.component.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.component.ts @@ -65,7 +65,7 @@ export class DocumentMenuActionComponent implements OnChanges { private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-alfresco-documentlist', 'node_modules/ng2-alfresco-documentlist/src'); + translateService.addTranslationFolder('ng2-alfresco-documentlist', 'assets/ng2-alfresco-documentlist'); } } diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.spec.ts index f557a98d4c..c4607e2359 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.spec.ts @@ -30,7 +30,7 @@ describe('DocumentActionsService', () => { beforeEach(() => { documentListService = new DocumentListServiceMock(); - contentService = new AlfrescoContentService(null, null); + contentService = new AlfrescoContentService(null, null, null); service = new DocumentActionsService(documentListService, contentService); }); diff --git a/ng2-components/ng2-alfresco-login/config/webpack.common.js b/ng2-components/ng2-alfresco-login/config/webpack.common.js index b9614b724c..c5c45806ce 100644 --- a/ng2-components/ng2-alfresco-login/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-login/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-login/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-login/demo/config/webpack.common.js b/ng2-components/ng2-alfresco-login/demo/config/webpack.common.js index a64b0c6926..ead063bef4 100644 --- a/ng2-components/ng2-alfresco-login/demo/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-login/demo/config/webpack.common.js @@ -103,14 +103,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts index a9076422b5..d443ed86fb 100644 --- a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts +++ b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts @@ -93,7 +93,7 @@ export class AlfrescoLoginComponent implements OnInit { private logService: LogService) { if (translateService) { - translateService.addTranslationFolder('ng2-alfresco-login', 'node_modules/ng2-alfresco-login/src'); + translateService.addTranslationFolder('ng2-alfresco-login', 'assets/ng2-alfresco-login'); } this.initFormError(); diff --git a/ng2-components/ng2-alfresco-search/config/webpack.common.js b/ng2-components/ng2-alfresco-search/config/webpack.common.js index b9614b724c..f83c187652 100644 --- a/ng2-components/ng2-alfresco-search/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-search/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-search/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-search/demo/config/webpack.common.js b/ng2-components/ng2-alfresco-search/demo/config/webpack.common.js index ef3e400d2c..560987838b 100644 --- a/ng2-components/ng2-alfresco-search/demo/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-search/demo/config/webpack.common.js @@ -106,14 +106,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.spec.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.spec.ts index 7cc0a940fc..3e2a83c70d 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.spec.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.spec.ts @@ -67,7 +67,7 @@ describe('AlfrescoSearchAutocompleteComponent', () => { let translationService = fixture.debugElement.injector.get(AlfrescoTranslationService); spyOn(translationService, 'addTranslationFolder'); fixture.detectChanges(); - expect(translationService.addTranslationFolder).toHaveBeenCalledWith('ng2-alfresco-search', 'node_modules/ng2-alfresco-search/src'); + expect(translationService.addTranslationFolder).toHaveBeenCalledWith('ng2-alfresco-search', 'assets/ng2-alfresco-search'); }); describe('search results', () => { diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts index 798b877004..ed5b63a4f7 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts @@ -74,7 +74,7 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges { ngOnInit(): void { if (this.translateService) { - this.translateService.addTranslationFolder('ng2-alfresco-search', 'node_modules/ng2-alfresco-search/src'); + this.translateService.addTranslationFolder('ng2-alfresco-search', 'assets/ng2-alfresco-search'); } } diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.spec.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.spec.ts index b7315e18ab..81dd7539b0 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.spec.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.spec.ts @@ -69,7 +69,7 @@ describe('AlfrescoSearchControlComponent', () => { spyOn(translationService, 'addTranslationFolder'); fixture.detectChanges(); expect(translationService.addTranslationFolder) - .toHaveBeenCalledWith('ng2-alfresco-search', 'node_modules/ng2-alfresco-search/src'); + .toHaveBeenCalledWith('ng2-alfresco-search', 'assets/ng2-alfresco-search'); }); it('should emit searchChange when search term input changed', (done) => { diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts index 3dd7b15804..270dfa2e5c 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts @@ -102,7 +102,7 @@ export class AlfrescoSearchControlComponent implements OnInit, OnDestroy { this.setupFocusEventHandlers(); - this.translateService.addTranslationFolder('ng2-alfresco-search', 'node_modules/ng2-alfresco-search/src'); + this.translateService.addTranslationFolder('ng2-alfresco-search', 'assets/ng2-alfresco-search'); } ngOnDestroy(): void { diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.spec.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.spec.ts index 28674bccb5..e1c0ecc988 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.spec.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.spec.ts @@ -157,7 +157,7 @@ describe('AlfrescoSearchComponent', () => { fixture.detectChanges(); - expect(translationService.addTranslationFolder).toHaveBeenCalledWith('ng2-alfresco-search', 'node_modules/ng2-alfresco-search/src'); + expect(translationService.addTranslationFolder).toHaveBeenCalledWith('ng2-alfresco-search', 'assets/ng2-alfresco-search'); }); describe('Search results', () => { diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.ts index e1a8918bfb..35fb10860c 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.ts @@ -72,7 +72,7 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit { ngOnInit() { if (this.translateService !== null) { - this.translateService.addTranslationFolder('ng2-alfresco-search', 'node_modules/ng2-alfresco-search/src'); + this.translateService.addTranslationFolder('ng2-alfresco-search', 'assets/ng2-alfresco-search'); } if (this.route) { diff --git a/ng2-components/ng2-alfresco-social/config/webpack.common.js b/ng2-components/ng2-alfresco-social/config/webpack.common.js index b9614b724c..0dfa8b96ca 100644 --- a/ng2-components/ng2-alfresco-social/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-social/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-social/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-social/demo/config/webpack.common.js b/ng2-components/ng2-alfresco-social/demo/config/webpack.common.js index ea0bb7090c..b34ec00ed8 100644 --- a/ng2-components/ng2-alfresco-social/demo/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-social/demo/config/webpack.common.js @@ -103,14 +103,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-alfresco-social/src/i18n/en.json b/ng2-components/ng2-alfresco-social/src/i18n/en.json new file mode 100644 index 0000000000..0db3279e44 --- /dev/null +++ b/ng2-components/ng2-alfresco-social/src/i18n/en.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/ng2-components/ng2-alfresco-tag/config/webpack.common.js b/ng2-components/ng2-alfresco-tag/config/webpack.common.js index b9614b724c..21cb08cdb8 100644 --- a/ng2-components/ng2-alfresco-tag/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-tag/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-tag/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-tag/demo/config/webpack.common.js b/ng2-components/ng2-alfresco-tag/demo/config/webpack.common.js index 49bd4fa1b1..87d3f2dde2 100644 --- a/ng2-components/ng2-alfresco-tag/demo/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-tag/demo/config/webpack.common.js @@ -103,14 +103,7 @@ module.exports = { context: 'resources/i18n', from: '**/*.json', to: 'resources/i18n' - }, - ... alfrescoLibs.map(lib => { - return { - context: 'node_modules', - from: `${lib}/src/i18n/*.json`, - to: 'node_modules' - } - }) + } ]), new webpack.optimize.CommonsChunkPlugin({ diff --git a/ng2-components/ng2-alfresco-tag/src/components/tag-actions.component.ts b/ng2-components/ng2-alfresco-tag/src/components/tag-actions.component.ts index 95bdd2ad87..6d28dd5070 100644 --- a/ng2-components/ng2-alfresco-tag/src/components/tag-actions.component.ts +++ b/ng2-components/ng2-alfresco-tag/src/components/tag-actions.component.ts @@ -58,7 +58,7 @@ export class TagActionsComponent { constructor(private tagService: TagService, private translateService: AlfrescoTranslationService) { if (translateService) { - translateService.addTranslationFolder('ng2-alfresco-tag', 'node_modules/ng2-alfresco-tag/src'); + translateService.addTranslationFolder('ng2-alfresco-tag', 'assets/ng2-alfresco-tag'); } this.tagService.refresh.subscribe(() => { diff --git a/ng2-components/ng2-alfresco-upload/config/webpack.common.js b/ng2-components/ng2-alfresco-upload/config/webpack.common.js index b9614b724c..61f8702687 100644 --- a/ng2-components/ng2-alfresco-upload/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-upload/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-upload/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.ts b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.ts index eef1571632..08de586a3a 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.ts @@ -53,7 +53,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy { translateService: AlfrescoTranslationService, private uploadService: UploadService) { if (translateService) { - translateService.addTranslationFolder('ng2-alfresco-upload', 'node_modules/ng2-alfresco-upload/src'); + translateService.addTranslationFolder('ng2-alfresco-upload', 'assets/ng2-alfresco-upload'); } } diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts index 05bdd0cc97..3c606a91cd 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts @@ -108,7 +108,7 @@ export class UploadButtonComponent implements OnInit, OnChanges { private notificationService: NotificationService, private settingsService: AlfrescoSettingsService) { if (translateService) { - translateService.addTranslationFolder('ng2-alfresco-upload', 'node_modules/ng2-alfresco-upload/src'); + translateService.addTranslationFolder('ng2-alfresco-upload', 'assets/ng2-alfresco-upload'); } } diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts index 576a954d3c..43cf6efa11 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts @@ -63,7 +63,7 @@ export class UploadDragAreaComponent { private logService: LogService, private notificationService: NotificationService) { if (translateService) { - translateService.addTranslationFolder('ng2-alfresco-upload', 'node_modules/ng2-alfresco-upload/src'); + translateService.addTranslationFolder('ng2-alfresco-upload', 'assets/ng2-alfresco-upload'); } } diff --git a/ng2-components/ng2-alfresco-userinfo/config/webpack.common.js b/ng2-components/ng2-alfresco-userinfo/config/webpack.common.js index b9614b724c..7ce8ec2531 100644 --- a/ng2-components/ng2-alfresco-userinfo/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-userinfo/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-userinfo/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-userinfo/src/components/user-info.component.ts b/ng2-components/ng2-alfresco-userinfo/src/components/user-info.component.ts index fc51f3142d..b61f95f90e 100644 --- a/ng2-components/ng2-alfresco-userinfo/src/components/user-info.component.ts +++ b/ng2-components/ng2-alfresco-userinfo/src/components/user-info.component.ts @@ -54,7 +54,7 @@ export class UserInfoComponent implements OnInit { private authService: AlfrescoAuthenticationService, private translateService: AlfrescoTranslationService) { if (translateService) { - translateService.addTranslationFolder('ng2-alfresco-userinfo', 'node_modules/ng2-alfresco-userinfo/src'); + translateService.addTranslationFolder('ng2-alfresco-userinfo', 'assets/ng2-alfresco-userinfo'); } authService.onLogin.subscribe((response) => { this.getUserInfo(); diff --git a/ng2-components/ng2-alfresco-viewer/config/webpack.common.js b/ng2-components/ng2-alfresco-viewer/config/webpack.common.js index b9614b724c..a6d2b0dd3f 100644 --- a/ng2-components/ng2-alfresco-viewer/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-viewer/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -81,7 +82,7 @@ module.exports = { emitErrors: true, licenseFile: path.resolve(__dirname, './assets/license_header.txt') }, - exclude: [/node_modules/, /bundles/, /dist/, /demo/, /rendering-queue.services.ts/ ], + exclude: [/node_modules/, /bundles/, /dist/, /demo/, /rendering-queue.services.ts/], }, { test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-viewer/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-viewer/src/i18n/en.json b/ng2-components/ng2-alfresco-viewer/src/i18n/en.json new file mode 100644 index 0000000000..0db3279e44 --- /dev/null +++ b/ng2-components/ng2-alfresco-viewer/src/i18n/en.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/ng2-components/ng2-alfresco-webscript/config/webpack.common.js b/ng2-components/ng2-alfresco-webscript/config/webpack.common.js index b9614b724c..b112874c93 100644 --- a/ng2-components/ng2-alfresco-webscript/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-webscript/config/webpack.common.js @@ -2,6 +2,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); const fs = require('fs'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { @@ -110,6 +111,11 @@ module.exports = { }, plugins: [ + new CopyWebpackPlugin([{ + from: `src/i18n/`, + to: `bundles/assets/ng2-alfresco-webscript/i18n/` + }]), + new webpack.NoEmitOnErrorsPlugin(), new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')), diff --git a/ng2-components/ng2-alfresco-webscript/src/i18n/en.json b/ng2-components/ng2-alfresco-webscript/src/i18n/en.json new file mode 100644 index 0000000000..0db3279e44 --- /dev/null +++ b/ng2-components/ng2-alfresco-webscript/src/i18n/en.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/ng2-components/tsconfig.json b/ng2-components/tsconfig.json new file mode 100644 index 0000000000..ab7bce3546 --- /dev/null +++ b/ng2-components/tsconfig.json @@ -0,0 +1,38 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "skipLibCheck": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "removeComments": true, + "declaration": true, + "outDir": "./dist", + "lib": [ + "es2015", + "dom" + ], + "suppressImplicitAnyIndexErrors": true + }, + "exclude": [ + "*/node_modules", + "*/demo", + "config", + "coverage", + "node_modules", + "dist" + ], + "angularCompilerOptions": { + "strictMetadataEmit": false, + "skipTemplateCodegen": true + } +}