@tilde-nlp/ngx-translate 2.1.39 → 2.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3454,7 +3454,7 @@ class TldTranslateConfigService {
3454
3454
  return this._textToSpeechConfig;
3455
3455
  }
3456
3456
  initConfigs(configuration) {
3457
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38;
3457
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39;
3458
3458
  const config = (_a = configuration !== null && configuration !== void 0 ? configuration : this.config) !== null && _a !== void 0 ? _a : {};
3459
3459
  const core = config === null || config === void 0 ? void 0 : config.core;
3460
3460
  const file = config === null || config === void 0 ? void 0 : config.file;
@@ -3566,51 +3566,52 @@ class TldTranslateConfigService {
3566
3566
  this._textConfig.progressIndicatorTimeoutMiliSeconds = (_9 = text === null || text === void 0 ? void 0 : text.progressIndicatorTimeoutMiliSeconds) !== null && _9 !== void 0 ? _9 : 2000;
3567
3567
  this._textConfig.progressIndicatorTitleVisibleForVendors = (_10 = text === null || text === void 0 ? void 0 : text.progressIndicatorTitleVisibleForVendors) !== null && _10 !== void 0 ? _10 : ["ETranslation"];
3568
3568
  this._textConfig.progressIndicatorVisible = (_11 = text === null || text === void 0 ? void 0 : text.progressIndicatorVisible) !== null && _11 !== void 0 ? _11 : false;
3569
- this._audioConfig.audioTextInput = (_12 = audio === null || audio === void 0 ? void 0 : audio.audioTextInput) !== null && _12 !== void 0 ? _12 : false;
3569
+ this._textConfig.showTranslateButton = (_12 = text === null || text === void 0 ? void 0 : text.showTranslateButton) !== null && _12 !== void 0 ? _12 : true;
3570
+ this._audioConfig.audioTextInput = (_13 = audio === null || audio === void 0 ? void 0 : audio.audioTextInput) !== null && _13 !== void 0 ? _13 : false;
3570
3571
  // Not setting default url because there is no service provided by Tilde and this is not used by default in website project.
3571
3572
  this._audioConfig.audioApiUrl = audio === null || audio === void 0 ? void 0 : audio.audioApiUrl;
3572
- this._audioConfig.audioMaxSizeBytes = (_13 = audio === null || audio === void 0 ? void 0 : audio.audioMaxSizeBytes) !== null && _13 !== void 0 ? _13 : 10000000;
3573
- this._audioConfig.sourceLanguages = (_14 = audio === null || audio === void 0 ? void 0 : audio.sourceLanguages) !== null && _14 !== void 0 ? _14 : [];
3574
- this._audioConfig.dataUpdateTimeFrame = (_15 = audio === null || audio === void 0 ? void 0 : audio.dataUpdateTimeFrame) !== null && _15 !== void 0 ? _15 : 5000;
3575
- this._audioConfig.maximumRecordTime = (_16 = audio === null || audio === void 0 ? void 0 : audio.maximumRecordTime) !== null && _16 !== void 0 ? _16 : 300;
3576
- this._audioConfig.dictateApiUrl = (_17 = audio === null || audio === void 0 ? void 0 : audio.dictateApiUrl) !== null && _17 !== void 0 ? _17 : "runa.tilde.lv";
3573
+ this._audioConfig.audioMaxSizeBytes = (_14 = audio === null || audio === void 0 ? void 0 : audio.audioMaxSizeBytes) !== null && _14 !== void 0 ? _14 : 10000000;
3574
+ this._audioConfig.sourceLanguages = (_15 = audio === null || audio === void 0 ? void 0 : audio.sourceLanguages) !== null && _15 !== void 0 ? _15 : [];
3575
+ this._audioConfig.dataUpdateTimeFrame = (_16 = audio === null || audio === void 0 ? void 0 : audio.dataUpdateTimeFrame) !== null && _16 !== void 0 ? _16 : 5000;
3576
+ this._audioConfig.maximumRecordTime = (_17 = audio === null || audio === void 0 ? void 0 : audio.maximumRecordTime) !== null && _17 !== void 0 ? _17 : 300;
3577
+ this._audioConfig.dictateApiUrl = (_18 = audio === null || audio === void 0 ? void 0 : audio.dictateApiUrl) !== null && _18 !== void 0 ? _18 : "runa.tilde.lv";
3577
3578
  this._audioConfig.appId = audio === null || audio === void 0 ? void 0 : audio.appId;
3578
3579
  this._audioConfig.appSecret = audio === null || audio === void 0 ? void 0 : audio.appSecret;
3579
- this._audioConfig.punctuationMessage = (_18 = audio === null || audio === void 0 ? void 0 : audio.punctuationMessage) !== null && _18 !== void 0 ? _18 : true;
3580
- this._audioConfig.disableAutomaticTranslation = (_19 = audio === null || audio === void 0 ? void 0 : audio.disableAutomaticTranslation) !== null && _19 !== void 0 ? _19 : true;
3580
+ this._audioConfig.punctuationMessage = (_19 = audio === null || audio === void 0 ? void 0 : audio.punctuationMessage) !== null && _19 !== void 0 ? _19 : true;
3581
+ this._audioConfig.disableAutomaticTranslation = (_20 = audio === null || audio === void 0 ? void 0 : audio.disableAutomaticTranslation) !== null && _20 !== void 0 ? _20 : true;
3581
3582
  this._webtranslateConfig.logoLocation = (webtranslate === null || webtranslate === void 0 ? void 0 : webtranslate.logoLocation) || 'assets/webtranslate/tilde_logo.png';
3582
3583
  this._webtranslateConfig.translatePagePath = webtranslate === null || webtranslate === void 0 ? void 0 : webtranslate.translatePagePath;
3583
3584
  this._webtranslateConfig.debug = (webtranslate === null || webtranslate === void 0 ? void 0 : webtranslate.debug) || false;
3584
3585
  this._webtranslateConfig.webLangAutodetect = (webtranslate === null || webtranslate === void 0 ? void 0 : webtranslate.webLangAutodetect) || true;
3585
3586
  this._webtranslateConfig.allowSuggestions = (webtranslate === null || webtranslate === void 0 ? void 0 : webtranslate.allowSuggestions) || false;
3586
3587
  this._webtranslateConfig.hidePopup = (webtranslate === null || webtranslate === void 0 ? void 0 : webtranslate.hidePopup) || false;
3587
- this._webtranslateConfig.sandbox = (_20 = webtranslate === null || webtranslate === void 0 ? void 0 : webtranslate.sandbox) !== null && _20 !== void 0 ? _20 : "allow-forms allow-scripts allow-same-origin";
3588
+ this._webtranslateConfig.sandbox = (_21 = webtranslate === null || webtranslate === void 0 ? void 0 : webtranslate.sandbox) !== null && _21 !== void 0 ? _21 : "allow-forms allow-scripts allow-same-origin";
3588
3589
  this._termConfig.terminologyPortalUrl = (termConfig === null || termConfig === void 0 ? void 0 : termConfig.terminologyPortalUrl) || "https://term.tilde.com";
3589
3590
  this._termConfig.canCreateCollection = termConfig === null || termConfig === void 0 ? void 0 : termConfig.canCreateCollection;
3590
3591
  this._termConfig.isCollectionsActivated = termConfig === null || termConfig === void 0 ? void 0 : termConfig.isCollectionsActivated;
3591
- this._termConfig.isTermPortalSupported = (_21 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.isTermPortalSupported) !== null && _21 !== void 0 ? _21 : false;
3592
- this._termConfig.collectionNameMinLength = (_22 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.collectionNameMinLength) !== null && _22 !== void 0 ? _22 : 8;
3593
- this._termConfig.collectionNameMaxLength = (_23 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.collectionNameMaxLength) !== null && _23 !== void 0 ? _23 : 300;
3594
- this._termConfig.refreshTimeoutMs = (_24 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.refreshTimeoutMs) !== null && _24 !== void 0 ? _24 : 10000;
3595
- this._termConfig.refreshTimeoutMsWhenImporting = (_25 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.refreshTimeoutMsWhenImporting) !== null && _25 !== void 0 ? _25 : 5000;
3592
+ this._termConfig.isTermPortalSupported = (_22 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.isTermPortalSupported) !== null && _22 !== void 0 ? _22 : false;
3593
+ this._termConfig.collectionNameMinLength = (_23 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.collectionNameMinLength) !== null && _23 !== void 0 ? _23 : 8;
3594
+ this._termConfig.collectionNameMaxLength = (_24 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.collectionNameMaxLength) !== null && _24 !== void 0 ? _24 : 300;
3595
+ this._termConfig.refreshTimeoutMs = (_25 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.refreshTimeoutMs) !== null && _25 !== void 0 ? _25 : 10000;
3596
+ this._termConfig.refreshTimeoutMsWhenImporting = (_26 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.refreshTimeoutMsWhenImporting) !== null && _26 !== void 0 ? _26 : 5000;
3596
3597
  this._termConfig.engineTermUrl = termConfig === null || termConfig === void 0 ? void 0 : termConfig.engineTermUrl;
3597
3598
  this._termConfig.defaultGlossaryManagementLink = termConfig === null || termConfig === void 0 ? void 0 : termConfig.defaultGlossaryManagementLink;
3598
- this._termConfig.freeTrialUrl = (_26 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.freeTrialUrl) !== null && _26 !== void 0 ? _26 : "https://tilde.com/products-and-services/machine-translation/pricing/Tilde-MT";
3599
- this._termConfig.learnMoreUrl = (_27 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.learnMoreUrl) !== null && _27 !== void 0 ? _27 : "https://www.tilde.com/products-and-services/machine-translation/Tilde-MT-features-glossary";
3599
+ this._termConfig.freeTrialUrl = (_27 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.freeTrialUrl) !== null && _27 !== void 0 ? _27 : "https://tilde.com/products-and-services/machine-translation/pricing/Tilde-MT";
3600
+ this._termConfig.learnMoreUrl = (_28 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.learnMoreUrl) !== null && _28 !== void 0 ? _28 : "https://www.tilde.com/products-and-services/machine-translation/Tilde-MT-features-glossary";
3600
3601
  // seperated because following urls have method names added
3601
3602
  this._coreConfig.translationServiceUrl = (core === null || core === void 0 ? void 0 : core.translationServiceUrl) || "https://www.letsmt.eu/ws/service.svc/json/";
3602
- this._textConfig.translationUrl = (_28 = text === null || text === void 0 ? void 0 : text.translationUrl) !== null && _28 !== void 0 ? _28 : this._coreConfig.translationServiceUrl + "TranslateEx";
3603
- this._textConfig.updateTranslationUrl = (_29 = text === null || text === void 0 ? void 0 : text.updateTranslationUrl) !== null && _29 !== void 0 ? _29 : this._coreConfig.translationServiceUrl + "UpdateTranslation";
3604
- this._coreConfig.systemListUrl = (_30 = core === null || core === void 0 ? void 0 : core.systemListUrl) !== null && _30 !== void 0 ? _30 : this._coreConfig.translationServiceUrl + "GetSystemList";
3603
+ this._textConfig.translationUrl = (_29 = text === null || text === void 0 ? void 0 : text.translationUrl) !== null && _29 !== void 0 ? _29 : this._coreConfig.translationServiceUrl + "TranslateEx";
3604
+ this._textConfig.updateTranslationUrl = (_30 = text === null || text === void 0 ? void 0 : text.updateTranslationUrl) !== null && _30 !== void 0 ? _30 : this._coreConfig.translationServiceUrl + "UpdateTranslation";
3605
+ this._coreConfig.systemListUrl = (_31 = core === null || core === void 0 ? void 0 : core.systemListUrl) !== null && _31 !== void 0 ? _31 : this._coreConfig.translationServiceUrl + "GetSystemList";
3605
3606
  this._apiV2Config.xApiKey = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.xApiKey;
3606
- this._apiV2Config.mtApiUrl = (_31 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.mtApiUrl) !== null && _31 !== void 0 ? _31 : "api/translate/";
3607
- this._apiV2Config.systemListUrl = (_32 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.systemListUrl) !== null && _32 !== void 0 ? _32 : this._apiV2Config.mtApiUrl + "language-directions";
3608
- this._apiV2Config.translationUrl = (_33 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.translationUrl) !== null && _33 !== void 0 ? _33 : this._apiV2Config.mtApiUrl + "text";
3609
- this._apiV2Config.fileTranslationUrl = (_34 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.fileTranslationUrl) !== null && _34 !== void 0 ? _34 : this._apiV2Config.mtApiUrl + "file";
3610
- this._apiV2Config.grammarCheckUrl = (_35 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.grammarCheckUrl) !== null && _35 !== void 0 ? _35 : "https://mt.cs.ut.ee/api/grammar";
3611
- this._apiV2Config.autoDomainDetection = (_36 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.autoDomainDetection) !== null && _36 !== void 0 ? _36 : false;
3612
- this._textToSpeechConfig.languages = (_37 = textToSpeech === null || textToSpeech === void 0 ? void 0 : textToSpeech.languages) !== null && _37 !== void 0 ? _37 : {};
3613
- this._textToSpeechConfig.maxCharsInText = (_38 = textToSpeech === null || textToSpeech === void 0 ? void 0 : textToSpeech.maxCharsInText) !== null && _38 !== void 0 ? _38 : 3000;
3607
+ this._apiV2Config.mtApiUrl = (_32 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.mtApiUrl) !== null && _32 !== void 0 ? _32 : "api/translate/";
3608
+ this._apiV2Config.systemListUrl = (_33 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.systemListUrl) !== null && _33 !== void 0 ? _33 : this._apiV2Config.mtApiUrl + "language-directions";
3609
+ this._apiV2Config.translationUrl = (_34 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.translationUrl) !== null && _34 !== void 0 ? _34 : this._apiV2Config.mtApiUrl + "text";
3610
+ this._apiV2Config.fileTranslationUrl = (_35 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.fileTranslationUrl) !== null && _35 !== void 0 ? _35 : this._apiV2Config.mtApiUrl + "file";
3611
+ this._apiV2Config.grammarCheckUrl = (_36 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.grammarCheckUrl) !== null && _36 !== void 0 ? _36 : "https://mt.cs.ut.ee/api/grammar";
3612
+ this._apiV2Config.autoDomainDetection = (_37 = apiV2Config === null || apiV2Config === void 0 ? void 0 : apiV2Config.autoDomainDetection) !== null && _37 !== void 0 ? _37 : false;
3613
+ this._textToSpeechConfig.languages = (_38 = textToSpeech === null || textToSpeech === void 0 ? void 0 : textToSpeech.languages) !== null && _38 !== void 0 ? _38 : {};
3614
+ this._textToSpeechConfig.maxCharsInText = (_39 = textToSpeech === null || textToSpeech === void 0 ? void 0 : textToSpeech.maxCharsInText) !== null && _39 !== void 0 ? _39 : 3000;
3614
3615
  this.editPropertiesBasedOnApi();
3615
3616
  }
3616
3617
  /**
@@ -6070,11 +6071,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
6070
6071
  }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: i1$3.HttpClient }]; } });
6071
6072
 
6072
6073
  class TerminologyService {
6073
- constructor(config, termApi, alerts, button, mtApi) {
6074
+ constructor(config, termApi, alerts, mtApi) {
6074
6075
  this.config = config;
6075
6076
  this.termApi = termApi;
6076
6077
  this.alerts = alerts;
6077
- this.button = button;
6078
6078
  this.mtApi = mtApi;
6079
6079
  this._selected = null;
6080
6080
  this.onDataUpdate = new Subject();
@@ -6083,7 +6083,6 @@ class TerminologyService {
6083
6083
  get selected() { return this._selected; }
6084
6084
  set selected(val) {
6085
6085
  this._selected = val;
6086
- this.button.actionButtonClicked();
6087
6086
  this.storeSelectedInLocalStorage();
6088
6087
  if (!this._selected) {
6089
6088
  return;
@@ -6372,7 +6371,7 @@ class TerminologyService {
6372
6371
  this.onDataUpdate.next(this.collections);
6373
6372
  }
6374
6373
  }
6375
- TerminologyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, deps: [{ token: TldTranslateConfigService }, { token: TermApiService }, { token: TldAlertService }, { token: TldTranslateButtonService }, { token: MT_TERM_API_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
6374
+ TerminologyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, deps: [{ token: TldTranslateConfigService }, { token: TermApiService }, { token: TldAlertService }, { token: MT_TERM_API_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
6376
6375
  TerminologyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, providedIn: 'root' });
6377
6376
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, decorators: [{
6378
6377
  type: Injectable,
@@ -6380,7 +6379,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
6380
6379
  providedIn: 'root'
6381
6380
  }]
6382
6381
  }], ctorParameters: function () {
6383
- return [{ type: TldTranslateConfigService }, { type: TermApiService }, { type: TldAlertService }, { type: TldTranslateButtonService }, { type: undefined, decorators: [{
6382
+ return [{ type: TldTranslateConfigService }, { type: TermApiService }, { type: TldAlertService }, { type: undefined, decorators: [{
6384
6383
  type: Inject,
6385
6384
  args: [MT_TERM_API_TOKEN]
6386
6385
  }] }];
@@ -10483,7 +10482,7 @@ class TldTranslateComponent {
10483
10482
  || this.translateTextService.isDictating;
10484
10483
  }
10485
10484
  get showTranslateButton() {
10486
- return !this.translateFileService.multipleFileUploadActive;
10485
+ return this.configService.textConfig.showTranslateButton && !this.translateFileService.multipleFileUploadActive;
10487
10486
  }
10488
10487
  // this param is necessary to remove max height if multiple file component is active, since there shouldn't be max height in that case.
10489
10488
  get isMultipleFilesActive() {