From 5f739b59ebba2770b07982e966526105ef246242 Mon Sep 17 00:00:00 2001 From: Leonty Chudinov Date: Fri, 19 Nov 2021 09:21:15 +0500 Subject: [PATCH 1/4] Upgrade angular-l10n Signed-off-by: Leonty Chudinov --- webClient/package-lock.json | 16 ++++++++++++---- webClient/package.json | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/webClient/package-lock.json b/webClient/package-lock.json index c862002..7540ac9 100644 --- a/webClient/package-lock.json +++ b/webClient/package-lock.json @@ -3041,12 +3041,20 @@ "dev": true }, "angular-l10n": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/angular-l10n/-/angular-l10n-5.2.0.tgz", - "integrity": "sha512-/dv3WgjkecrzAt5lyOheoamHCeYuiXUir7soq5YWILIV1G7YlGCOx5yPOSjV8XQ7QUnnR3QgAv+SxxvbQMXsZg==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/angular-l10n/-/angular-l10n-12.0.1.tgz", + "integrity": "sha512-Juh+FsAiK47MOPA3WniisNhfY0h393Tnr1oH/D1rnopGY1xVDFCKSzeLNpL8n4SIumnVLY5rst0+1pX7r8tEUg==", "dev": true, "requires": { - "tslib": "^1.9.0" + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", + "dev": true + } } }, "angular2-template-loader": { diff --git a/webClient/package.json b/webClient/package.json index 3cd5b15..a27ae1f 100644 --- a/webClient/package.json +++ b/webClient/package.json @@ -22,7 +22,7 @@ "@angular/platform-browser-dynamic": "~12.0.0", "@angular/router": "~12.0.0", "@zlux/widgets": "git+ssh://git@github.com/zowe/zlux-widgets.git#feature/upgrade-angular", - "angular-l10n": "5.2.0", + "angular-l10n": "~12.0.0", "angular2-template-loader": "~0.6.2", "codelyzer": "~4.4.2", "compression-webpack-plugin": "~6.1.1", From d1ffd5c82ce82246c0ea3485129c2e4a046033f6 Mon Sep 17 00:00:00 2001 From: Leonty Chudinov Date: Mon, 22 Nov 2021 18:16:13 +0500 Subject: [PATCH 2/4] Replace angular-l10n with @angular/localize Signed-off-by: Leonty Chudinov --- webClient/package-lock.json | 152 +++++++++++++++++++++++++---- webClient/package.json | 2 +- webClient/src/app/app.component.ts | 74 +++++++------- webClient/src/app/app.module.ts | 30 +----- webClient/src/polyfills.ts | 8 +- webClient/src/typings.d.ts | 2 + webClient/tsconfig.json | 5 +- 7 files changed, 182 insertions(+), 91 deletions(-) diff --git a/webClient/package-lock.json b/webClient/package-lock.json index 7540ac9..cfe454d 100644 --- a/webClient/package-lock.json +++ b/webClient/package-lock.json @@ -1280,6 +1280,141 @@ "integrity": "sha512-mhb21Ixdky3KOAQ9eps16tzP5hm/uKwCToLM244Llgozem1zHdfc2LPePAwWt/9fSl642xX2JKWjjKFgC4bgNw==", "dev": true }, + "@angular/localize": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-12.0.5.tgz", + "integrity": "sha512-CRyXsNJYV7TJBsbG/Sn6lW9qMQCa+lw5SSNKHvnmfCTyd5p3DV8AdjOYkyWM5tfB4wg/aOc4C1ynDom4TmKv+w==", + "dev": true, + "requires": { + "@babel/core": "7.8.3", + "glob": "7.1.7", + "yargs": "^16.2.0" + }, + "dependencies": { + "@babel/core": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.3.tgz", + "integrity": "sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.8.3", + "@babel/helpers": "^7.8.3", + "@babel/parser": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.0", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + } + } + }, "@angular/platform-browser": { "version": "12.0.5", "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-12.0.5.tgz", @@ -3040,23 +3175,6 @@ "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", "dev": true }, - "angular-l10n": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/angular-l10n/-/angular-l10n-12.0.1.tgz", - "integrity": "sha512-Juh+FsAiK47MOPA3WniisNhfY0h393Tnr1oH/D1rnopGY1xVDFCKSzeLNpL8n4SIumnVLY5rst0+1pX7r8tEUg==", - "dev": true, - "requires": { - "tslib": "^2.2.0" - }, - "dependencies": { - "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", - "dev": true - } - } - }, "angular2-template-loader": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/angular2-template-loader/-/angular2-template-loader-0.6.2.tgz", diff --git a/webClient/package.json b/webClient/package.json index a27ae1f..25fead5 100644 --- a/webClient/package.json +++ b/webClient/package.json @@ -18,11 +18,11 @@ "@angular/core": "~12.0.0", "@angular/forms": "~12.0.0", "@angular/language-service": "~12.0.0", + "@angular/localize": "~12.0.0", "@angular/platform-browser": "~12.0.0", "@angular/platform-browser-dynamic": "~12.0.0", "@angular/router": "~12.0.0", "@zlux/widgets": "git+ssh://git@github.com/zowe/zlux-widgets.git#feature/upgrade-angular", - "angular-l10n": "~12.0.0", "angular2-template-loader": "~0.6.2", "codelyzer": "~4.4.2", "compression-webpack-plugin": "~6.1.1", diff --git a/webClient/src/app/app.component.ts b/webClient/src/app/app.component.ts index acb1191..46a899f 100644 --- a/webClient/src/app/app.component.ts +++ b/webClient/src/app/app.component.ts @@ -18,7 +18,6 @@ import { ZluxPopupManagerService, ZluxErrorSeverity } from '@zlux/widgets'; import { HelloService } from './services/hello.service'; import { SettingsService } from './services/settings.service'; -import { LocaleService, TranslationService, Language } from 'angular-l10n'; import { catchError } from 'rxjs/operators'; import { zip, throwError } from 'rxjs'; import { StorageServer, StorageService, StorageType } from './services/storage.service'; @@ -32,7 +31,6 @@ import { HttpErrorResponse } from '@angular/common/http'; }) export class AppComponent { - @Language() lang: string; targetAppId: string = "org.zowe.terminal.tn3270"; callStatus: string; @@ -65,8 +63,6 @@ export class AppComponent { storageType?: StorageType; constructor( - public locale: LocaleService, - public translation: TranslationService, @Inject(Angular2InjectionTokens.PLUGIN_DEFINITION) private pluginDefinition: ZLUX.ContainerPluginDefinition, @Inject(Angular2InjectionTokens.LOGGER) private log: ZLUX.ComponentLogger, @Inject(Angular2InjectionTokens.LAUNCH_METADATA) private launchMetadata: any, @@ -176,11 +172,11 @@ export class AppComponent { .subscribe((res:any) => { if (res != null) { this.serverResponseMessage = - `${this.translation.translate('server_replied_with')} + $localize`server_replied_with "${res.serverResponse}"`; } else { - this.serverResponseMessage = ""; + this.serverResponseMessage = $localize``; } this.log.info(res); }); @@ -190,7 +186,7 @@ export class AppComponent { var parameters = null; const popupOptions = { blocking: true, - buttons: [this.translation.translate('close')] + buttons: [$localize`close`] }; /*Parameters for Actions could be a number, string, or object. The actual event context of an Action that an App recieves will be an object with attributes filled in via these parameters*/ try { @@ -225,76 +221,76 @@ export class AppComponent { */ let action = dispatcher.makeAction(actionID, actionTitle, mode,type,this.targetAppId,argumentFormatter); let argumentData = {'data':(parameters ? parameters : this.parameters)}; - this.log.info((message = this.translation.translate('request_succeeded'))); // App request succeeded + this.log.info((message = $localize`request_succeeded`)); // App request succeeded this.callStatus = message; /*Just because the Action is invoked does not mean the target App will accept it. We've made an Action on the fly, So the data could be in any shape under the "data" attribute and it is up to the target App to take action or ignore this request*/ dispatcher.invokeAction(action,argumentData); } else { - this.log.warn((message = 'Invalid target mode or action type specified')); + this.log.warn((message = $localize`Invalid target mode or action type specified`)); } } else { this.popupManager.reportError( ZluxErrorSeverity.WARNING, - this.translation.translate('invalid_plugin_identifier'), // - `${this.translation.translate('no_plugin_found_for_identifier')} ${this.targetAppId}`, popupOptions); + $localize`invalid_plugin_identifier`, + $localize`no_plugin_found_for_identifier ${this.targetAppId}`, popupOptions); } this.callStatus = message; } } - generateTestMenuItems(translator: TranslationService): void { + generateTestMenuItems(): void { this.menuItems = [ { - "text": translator.translate('items'), + "text": $localize`items`, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('items')); + this.log.info($localize`items`); }, "children": [ { - "text": translator.translate('item_1.1'), + "text": $localize`item_1.1`, // "icon": 'icon-settings', "action": () => { - this.log.info(translator.translate('item_1.1')); + this.log.info($localize`item_1.1`); }, "children": [ { - "text": translator.translate('item_1.1.1'), + "text": $localize`item_1.1.1`, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('item_1.1.1')); + this.log.info($localize`item_1.1.1`); } }, { - "text": translator.translate('item_1.1.2'), + "text": $localize`item_1.1.2`, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('item_1.1.2')); + this.log.info($localize`item_1.1.2`); } } ] }, { - "text": translator.translate('item_1.2'), + "text": $localize`item_1.2`, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('item_1.2')); + this.log.info($localize`item_1.2`); }, "children": [ { - "text": translator.translate('item_1.2.1'), + "text": $localize`item_1.2.1`, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('item_1.2.1')); + this.log.info($localize`item_1.2.1`); } }, { - "text": translator.translate('item_1.2.2'), + "text": $localize`item_1.2.2`, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('item_1.2.2')); + this.log.info($localize`item_1.2.2`); } } ] @@ -302,51 +298,51 @@ export class AppComponent { ] }, { - "text": translator.translate('disabled'), + "text": $localize`disabled`, "disabled": true, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('disabled')); + this.log.info($localize`disabled`); }, "children": [ { - "text": translator.translate('disabled_1.1'), + "text": $localize`disabled_1.1`, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('disabled_1.1')); + this.log.info($localize`disabled_1.1`); } }, { - "text": translator.translate('disabled_1.2'), + "text": $localize`disabled_1.2`, // "icon": 'icon-person', "action": () => { - this.log.info(translator.translate('disabled_1.2')); + this.log.info($localize`disabled_1.2`); } } ] }, { - "text": translator.translate('persisting_item'), + "text": $localize`persisting_item`, // "icon": 'icon-settings', "action": () => { - this.log.info(translator.translate('persisting_item')); + this.log.info($localize`persisting_item`); }, "preventCloseMenu": true, "children": [ { - "text": translator.translate('shortcut_item'), + "text": $localize`shortcut_item`, // "icon": 'icon-person', "shortcutText": 'F5', "action": () => { - this.log.info(translator.translate('shortcut_item')); + this.log.info($localize`shortcut_item`); } }, { - "text": translator.translate('persisting_shortcut_item'), + "text": $localize`persisting_shortcut_item`, // "icon": 'icon-person', "shortcutText": 'F6', "action": () => { - this.log.info(translator.translate('persisting_shortcut_item')); + this.log.info($localize`persisting_shortcut_item`); }, "preventCloseMenu": true } @@ -357,7 +353,7 @@ export class AppComponent { onRightClick(event: MouseEvent): boolean { if (this.windowActions) { - if (!this.menuItems) {this.generateTestMenuItems(this.translation);} + if (!this.menuItems) {this.generateTestMenuItems();} this.windowActions.spawnContextMenu(event.clientX, event.clientY, this.menuItems, true); } return false; diff --git a/webClient/src/app/app.module.ts b/webClient/src/app/app.module.ts index b6018ac..2e20683 100644 --- a/webClient/src/app/app.module.ts +++ b/webClient/src/app/app.module.ts @@ -11,31 +11,15 @@ */ import { CommonModule } from '@angular/common'; -import { NgModule, Inject } from '@angular/core'; +import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { ZluxButtonModule, ZluxPopupManagerModule } from '@zlux/widgets'; import { AppComponent } from './app.component'; import {HelloService} from './services/hello.service'; - -// import { L10nConfig, L10nLoader, TranslationModule, StorageStrategy, ProviderType } from 'angular-l10n'; -import { TranslationModule, L10nConfig, ISOCode, L10nLoader, LOCALE_CONFIG, - TRANSLATION_CONFIG, LocaleConfig, TranslationConfig } from 'angular-l10n'; -import { Angular2L10nConfig, Angular2InjectionTokens } from 'pluginlib/inject-resources'; import { StorageService } from './services/storage.service'; - -const l10nConfig: L10nConfig = { - translation: { - providers: [], - composedLanguage: [ISOCode.Language, ISOCode.Country], - caching: true, - missingValue: 'No key' - } -}; - - @NgModule({ declarations: [ AppComponent @@ -46,22 +30,12 @@ const l10nConfig: L10nConfig = { FormsModule, ZluxButtonModule, ZluxPopupManagerModule, - TranslationModule.forRoot(l10nConfig) ], providers: [HelloService, StorageService], bootstrap: [AppComponent] }) export class AppModule { - constructor( - private l10nLoader: L10nLoader, - @Inject(Angular2InjectionTokens.L10N_CONFIG) private l10nConfig: Angular2L10nConfig, - @Inject(LOCALE_CONFIG) private localeConfig: LocaleConfig, - @Inject(TRANSLATION_CONFIG) private translationConfig: TranslationConfig, - - ) { - this.localeConfig.defaultLocale = this.l10nConfig.defaultLocale; - this.translationConfig.providers = this.l10nConfig.providers; - this.l10nLoader.load(); + constructor() { } } diff --git a/webClient/src/polyfills.ts b/webClient/src/polyfills.ts index 5c3d8be..b590894 100644 --- a/webClient/src/polyfills.ts +++ b/webClient/src/polyfills.ts @@ -4,9 +4,9 @@ This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html - + SPDX-License-Identifier: EPL-2.0 - + Copyright Contributors to the Zowe Project. */ @@ -89,9 +89,9 @@ import 'zone.js/dist/zone'; // Included with Angular CLI. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html - + SPDX-License-Identifier: EPL-2.0 - + Copyright Contributors to the Zowe Project. */ diff --git a/webClient/src/typings.d.ts b/webClient/src/typings.d.ts index 406f807..dcdb02d 100644 --- a/webClient/src/typings.d.ts +++ b/webClient/src/typings.d.ts @@ -16,6 +16,8 @@ interface NodeModule { id: string; } +declare function $localize(messageParts: TemplateStringsArray, ...expressions: readonly any[]): string; + /* This program and the accompanying materials are diff --git a/webClient/tsconfig.json b/webClient/tsconfig.json index 203f569..e79ba25 100644 --- a/webClient/tsconfig.json +++ b/webClient/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../zlux-app-manager/virtual-desktop/plugin-config/tsconfig.strict.json" -} \ No newline at end of file + "extends": "../../zlux-app-manager/virtual-desktop/plugin-config/tsconfig.strict.json", + "include": ["src"] +} From 8afb6a12ae5daa34d97f28fd1faffcc93cc81ca7 Mon Sep 17 00:00:00 2001 From: Leonty Chudinov Date: Tue, 23 Nov 2021 09:36:38 +0500 Subject: [PATCH 3/4] Install ts-lib@~2.3.0 Signed-off-by: Leonty Chudinov --- webClient/package-lock.json | 106 +++++++++++++++++++++++++++++++++++- webClient/package.json | 4 +- 2 files changed, 106 insertions(+), 4 deletions(-) diff --git a/webClient/package-lock.json b/webClient/package-lock.json index cfe454d..2c155e1 100644 --- a/webClient/package-lock.json +++ b/webClient/package-lock.json @@ -21,6 +21,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } } } @@ -472,6 +480,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "schema-utils": { @@ -723,6 +739,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } } } @@ -747,6 +771,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } } } @@ -858,6 +890,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "supports-color": { @@ -1069,6 +1109,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "semver": { @@ -2760,6 +2808,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } } } @@ -7721,6 +7777,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "supports-color": { @@ -8273,6 +8337,12 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "optional": true + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true } } }, @@ -9025,6 +9095,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } } } @@ -10963,6 +11041,14 @@ "dev": true, "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "safe-buffer": { @@ -12379,9 +12465,9 @@ "dev": true }, "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true }, "tslint": { @@ -12415,6 +12501,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true } } }, @@ -12425,6 +12517,14 @@ "dev": true, "requires": { "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "tty-browserify": { diff --git a/webClient/package.json b/webClient/package.json index 25fead5..56ca151 100644 --- a/webClient/package.json +++ b/webClient/package.json @@ -5,7 +5,8 @@ "start": "webpack --progress --colors --watch", "build": "webpack --progress --colors", "i18n": "ng-xi18n -p tsconfig.i18n.json --i18nFormat=xlf --outFile=messages.xlf && xliffmerge -p xliffmerge.json", - "lint": "tslint -c tslint.json \"./**/*.ts\"" + "lint": "tslint -c tslint.json \"./**/*.ts\"", + "localize-extract": "localize-extract --format=legacy-migrate --source=../web/main.js --outputPath=./messages.json" }, "private": true, "devDependencies": { @@ -36,6 +37,7 @@ "rxjs": "~6.6.0", "source-map-loader": "~1.1.3", "ts-loader": "~8.3.0", + "tslib": "~2.3.0", "tslint": "~5.10.0", "typescript": "~4.2.0", "webpack": "~4.46.0", From d68be9a2dbf4acdcdf24b6cae1ac2339bfb2a80d Mon Sep 17 00:00:00 2001 From: Leonty Chudinov Date: Tue, 23 Nov 2021 12:59:02 +0500 Subject: [PATCH 4/4] Add localize command to package.json Signed-off-by: Leonty Chudinov --- webClient/package.json | 1 + webClient/tsconfig.i18n.json | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/webClient/package.json b/webClient/package.json index 56ca151..3c866b5 100644 --- a/webClient/package.json +++ b/webClient/package.json @@ -5,6 +5,7 @@ "start": "webpack --progress --colors --watch", "build": "webpack --progress --colors", "i18n": "ng-xi18n -p tsconfig.i18n.json --i18nFormat=xlf --outFile=messages.xlf && xliffmerge -p xliffmerge.json", + "localize": "localize-extract -s ../web/main.js -f xlf -o messages-l.xlf", "lint": "tslint -c tslint.json \"./**/*.ts\"", "localize-extract": "localize-extract --format=legacy-migrate --source=../web/main.js --outputPath=./messages.json" }, diff --git a/webClient/tsconfig.i18n.json b/webClient/tsconfig.i18n.json index 537b6ad..c6e5567 100644 --- a/webClient/tsconfig.i18n.json +++ b/webClient/tsconfig.i18n.json @@ -1,6 +1,6 @@ { "extends": "../../zlux-app-manager/virtual-desktop/plugin-config/tsconfig.ngx-i18n.json", - + "include": [ "./src" ], @@ -8,5 +8,9 @@ "compilerOptions": { "outDir": "./src/assets/i18n", "skipLibCheck": true + }, + "angularCompilerOptions": { + "enableIvy": false, + "enableI18nLegacyMessageIdFormat": false } }