From 70dd495920ab4c7687a130cc51794fcbc2569c2a Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 31 Oct 2016 11:14:23 +0000 Subject: [PATCH 1/4] Remove 'live reload' from default 'npm start' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `npm start` now runs demo shell without TS watchers and live reload (public/testing mode) - new `npm run start:dev` script to run ‘development’ mode with watchers and live reload --- demo-shell-ng2/package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/demo-shell-ng2/package.json b/demo-shell-ng2/package.json index 0c5e143ca0..299117bde3 100644 --- a/demo-shell-ng2/package.json +++ b/demo-shell-ng2/package.json @@ -6,11 +6,13 @@ "scripts": { "clean": "npm install rimraf && rimraf dist node_modules typings", "build": "npm run tslint && npm run tsc && npm run licensecheck", - "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run serve\" ", + "start": "npm run build && npm run serve", + "start:dev": "npm run build && concurrently \"npm run tsc:w\" \"npm run serve:dev\" ", "aws": "node app.js", "tsc": "tsc", "tsc:w": "tsc -w", - "serve": "wsrv -O http://localhost:3000 -s -l -p 3000 -a 0.0.0.0 -x ./server/versions.js", + "serve": "wsrv -O http://localhost:3000 -s -p 3000 -a 0.0.0.0 -x ./server/versions.js", + "serve:dev": "wsrv -O http://localhost:3000 -s -l -p 3000 -a 0.0.0.0 -x ./server/versions.js", "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json 'app/{,**/}**.ts'", "licensecheck": "license-check" }, From e2f3a65eec48391d1276bca4a26b89f5d3be8d8d Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 31 Oct 2016 11:32:09 +0000 Subject: [PATCH 2/4] Use native ng2-translate language detection Switch to ng2-translate language detection (that takes into account various cases) refs #932 refs #931 --- .../src/services/AlfrescoTranslation.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoTranslation.service.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoTranslation.service.ts index fa24e4dcc5..5313ec20fc 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoTranslation.service.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoTranslation.service.ts @@ -25,8 +25,7 @@ export class AlfrescoTranslationService { userLang: string = 'en' ; constructor(private translate: TranslateService) { - this.userLang = navigator.language.split('-')[0]; // use navigator lang if available - this.userLang = /(fr|en)/gi.test(this.userLang) ? this.userLang : 'en'; + this.userLang = translate.getBrowserLang() || 'en'; translate.setDefaultLang(this.userLang); } From 9513b370251f1eaa25bcbbe4c8718d06dfdf0885 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 31 Oct 2016 11:58:29 +0000 Subject: [PATCH 3/4] Minor script reorder (index.html) --- demo-shell-ng2/index.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/demo-shell-ng2/index.html b/demo-shell-ng2/index.html index 93ac0bfd52..2dbdbf8a4d 100644 --- a/demo-shell-ng2/index.html +++ b/demo-shell-ng2/index.html @@ -22,11 +22,14 @@ - + + + + @@ -37,12 +40,10 @@ + - - - From 03d0ce1d860e2198c7bf1297f1f7af9f992855b6 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 31 Oct 2016 12:04:11 +0000 Subject: [PATCH 4/4] Revert "Minor script reorder (index.html)" This reverts commit 9513b370251f1eaa25bcbbe4c8718d06dfdf0885. --- demo-shell-ng2/index.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/demo-shell-ng2/index.html b/demo-shell-ng2/index.html index 2dbdbf8a4d..93ac0bfd52 100644 --- a/demo-shell-ng2/index.html +++ b/demo-shell-ng2/index.html @@ -22,14 +22,11 @@ + - - - - @@ -40,10 +37,12 @@ - + + +