From 12ec05c77e55f77701497e6e9f087565ac53c34c Mon Sep 17 00:00:00 2001 From: Ebenezer Monney Date: Tue, 12 Dec 2017 19:50:09 +0000 Subject: [PATCH] [FIX] Angular5 AOT bug and warning during publish [FIX] Missing Portuguese language translation --- src/QuickApp/ClientApp/app/assets/locale/ar.json | 1 + src/QuickApp/ClientApp/app/assets/locale/de.json | 1 + src/QuickApp/ClientApp/app/assets/locale/en.json | 1 + src/QuickApp/ClientApp/app/assets/locale/fr.json | 1 + src/QuickApp/ClientApp/app/assets/locale/ko.json | 1 + src/QuickApp/ClientApp/app/assets/locale/pt.json | 2 +- src/QuickApp/ClientApp/app/components/app.component.ts | 2 +- .../app/components/controls/user-preferences.component.html | 2 +- .../ClientApp/app/services/app-translation.service.ts | 4 ++-- src/QuickApp/webpack.config.js | 6 +++--- src/QuickApp/webpack.config.vendor.js | 2 +- 11 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/QuickApp/ClientApp/app/assets/locale/ar.json b/src/QuickApp/ClientApp/app/assets/locale/ar.json index a8bc97a6e..b218277de 100644 --- a/src/QuickApp/ClientApp/app/assets/locale/ar.json +++ b/src/QuickApp/ClientApp/app/assets/locale/ar.json @@ -53,6 +53,7 @@ "English": "الإنجليزية", "French": "الفرنسية", "German": "الألمانية", + "Portuguese": "البرتغالية", "Arabic": "العربية", "Korean": "الكورية", "LanguageHint": "اختيار اللغة المفضلة لحسابك", diff --git a/src/QuickApp/ClientApp/app/assets/locale/de.json b/src/QuickApp/ClientApp/app/assets/locale/de.json index 2fa97c123..36e29a7ba 100644 --- a/src/QuickApp/ClientApp/app/assets/locale/de.json +++ b/src/QuickApp/ClientApp/app/assets/locale/de.json @@ -53,6 +53,7 @@ "English": "English", "French": "Französisch", "German": "Deutsch", + "Portuguese": "Portugiesisch", "Arabic": "Arabisch", "Korean": "Koreanisch", "LanguageHint": "Die bevorzugte Anzeigesprache auswählen", diff --git a/src/QuickApp/ClientApp/app/assets/locale/en.json b/src/QuickApp/ClientApp/app/assets/locale/en.json index e211b937e..93ee66254 100644 --- a/src/QuickApp/ClientApp/app/assets/locale/en.json +++ b/src/QuickApp/ClientApp/app/assets/locale/en.json @@ -53,6 +53,7 @@ "English": "English", "French": "French", "German": "German", + "Portuguese": "Portuguese", "Arabic": "Arabic", "Korean": "Korean", "LanguageHint": "Select the preferred language for your account", diff --git a/src/QuickApp/ClientApp/app/assets/locale/fr.json b/src/QuickApp/ClientApp/app/assets/locale/fr.json index 61c47cb8b..5540a66d3 100644 --- a/src/QuickApp/ClientApp/app/assets/locale/fr.json +++ b/src/QuickApp/ClientApp/app/assets/locale/fr.json @@ -53,6 +53,7 @@ "English": "Anglais", "French": "Français", "German": "Allemand", + "Portuguese": "Portugais", "Arabic": "Arabe", "Korean": "Coréen", "LanguageHint": "Sélectionnez la langue préférée pour votre compte", diff --git a/src/QuickApp/ClientApp/app/assets/locale/ko.json b/src/QuickApp/ClientApp/app/assets/locale/ko.json index fb399376c..34a53e847 100644 --- a/src/QuickApp/ClientApp/app/assets/locale/ko.json +++ b/src/QuickApp/ClientApp/app/assets/locale/ko.json @@ -53,6 +53,7 @@ "English": "영어", "French": "프랑스 국민", "German": "독일어", + "Portuguese": "포르투갈 인", "Arabic": "아라비아 말", "Korean": "한국어", "LanguageHint": "계정의 기본 언어 선택", diff --git a/src/QuickApp/ClientApp/app/assets/locale/pt.json b/src/QuickApp/ClientApp/app/assets/locale/pt.json index 89154a76b..7252746e0 100644 --- a/src/QuickApp/ClientApp/app/assets/locale/pt.json +++ b/src/QuickApp/ClientApp/app/assets/locale/pt.json @@ -53,9 +53,9 @@ "English": "English", "French": "Français", "German": "Deutsche", + "Portuguese": "Português", "Arabic": "عربى", "Korean": "한국어", - "Portuguese": "Português", "LanguageHint": "Selecione seu idioma", "HomePage": "Principal:", "Dashboard": "Painel de Controle", diff --git a/src/QuickApp/ClientApp/app/components/app.component.ts b/src/QuickApp/ClientApp/app/components/app.component.ts index 69a47a626..0d4ed2e41 100644 --- a/src/QuickApp/ClientApp/app/components/app.component.ts +++ b/src/QuickApp/ClientApp/app/components/app.component.ts @@ -70,7 +70,7 @@ export class AppComponent implements OnInit, AfterViewInit { storageManager.initialiseStorageSyncListener(); - translationService.addLanguages(["en", "fr", "de", "ar", "ko", "pt"]); + translationService.addLanguages(["en", "fr", "de", "pt", "ar", "ko"]); translationService.setDefaultLanguage('en'); diff --git a/src/QuickApp/ClientApp/app/components/controls/user-preferences.component.html b/src/QuickApp/ClientApp/app/components/controls/user-preferences.component.html index b65ed08d2..7bca93e52 100644 --- a/src/QuickApp/ClientApp/app/components/controls/user-preferences.component.html +++ b/src/QuickApp/ClientApp/app/components/controls/user-preferences.component.html @@ -24,9 +24,9 @@ + -
diff --git a/src/QuickApp/ClientApp/app/services/app-translation.service.ts b/src/QuickApp/ClientApp/app/services/app-translation.service.ts index 7a0d72af8..83031cbda 100644 --- a/src/QuickApp/ClientApp/app/services/app-translation.service.ts +++ b/src/QuickApp/ClientApp/app/services/app-translation.service.ts @@ -106,12 +106,12 @@ export class TranslateLanguageLoader implements TranslateLoader { return Observable.of(require("../assets/locale/fr.json")); case "de": return Observable.of(require("../assets/locale/de.json")); + case "pt": + return Observable.of(require("../assets/locale/pt.json")); case "ar": return Observable.of(require("../assets/locale/ar.json")); case "ko": return Observable.of(require("../assets/locale/ko.json")); - case "pt": - return Observable.of(require("../assets/locale/pt.json")); default: } } diff --git a/src/QuickApp/webpack.config.js b/src/QuickApp/webpack.config.js index e866453ac..5ba0c1c1f 100644 --- a/src/QuickApp/webpack.config.js +++ b/src/QuickApp/webpack.config.js @@ -9,7 +9,7 @@ const path = require('path'); const webpack = require('webpack'); const merge = require('webpack-merge'); -const AotPlugin = require('@ngtools/webpack').AotPlugin; +const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin; const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin; module.exports = (env) => { @@ -25,7 +25,7 @@ module.exports = (env) => { }, module: { rules: [ - { test: /\.ts$/, use: isDevBuild ? ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] : '@ngtools/webpack' }, + { test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, use: isDevBuild ? ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] : '@ngtools/webpack' }, { test: /\.html$/, use: 'html-loader?minimize=false' }, { test: /\.css$/, use: ['to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize'] }, { test: /\.scss$/, use: ['to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize', 'sass-loader'] }, @@ -54,7 +54,7 @@ module.exports = (env) => { ] : [ // Plugins that apply in production builds only new webpack.optimize.UglifyJsPlugin(), - new AotPlugin({ + new AngularCompilerPlugin({ tsConfigPath: './tsconfig.json', entryModule: path.join(__dirname, 'ClientApp/app/app.module#AppModule') }) diff --git a/src/QuickApp/webpack.config.vendor.js b/src/QuickApp/webpack.config.vendor.js index e9e005bce..b99ac2757 100644 --- a/src/QuickApp/webpack.config.vendor.js +++ b/src/QuickApp/webpack.config.vendor.js @@ -67,7 +67,7 @@ module.exports = (env) => { plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) new webpack.ContextReplacementPlugin(/\@angular\b.*\b(bundles|linker)/, path.join(__dirname, './ClientApp')), // Workaround for https://github.com/angular/angular/issues/11580 - new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/, path.join(__dirname, './ClientApp')), // Workaround for https://github.com/angular/angular/issues/14898 + new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)(@angular|esm5)/, path.join(__dirname, './ClientApp')), // Workaround for https://github.com/angular/angular/issues/14898 new webpack.IgnorePlugin(/^vertx$/) // Workaround for https://github.com/stefanpenner/es6-promise/issues/100 ] };