@tilde-nlp/ngx-translate 2.1.2 → 2.1.4

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.
@@ -823,7 +823,7 @@ const i18n_en = {
823
823
  "DRAG_AND_DROP": "or drag and drop ",
824
824
  "FILE": "a file",
825
825
  "FILES": "files",
826
- "LIMITS": " ({{visibleExtensions}}. Max {{maxSizeMB}}MB)",
826
+ "LIMITS": " ( {{visibleExtensions}}. Max {{maxSizeMB}}MB )",
827
827
  "CLEAR": "Clear file"
828
828
  },
829
829
  "SYSTEM_PICKER": {
@@ -3516,7 +3516,7 @@ class TldTranslateConfigService {
3516
3516
  this._webtranslateConfig.allowSuggestions = webtranslate?.allowSuggestions || false;
3517
3517
  this._webtranslateConfig.hidePopup = webtranslate?.hidePopup || false;
3518
3518
  this._webtranslateConfig.sandbox = webtranslate?.sandbox ?? "allow-forms allow-scripts allow-same-origin";
3519
- this._termConfig.apiUrl = termConfig?.apiUrl || "https://term.tilde.com";
3519
+ this._termConfig.terminologyPortalUrl = termConfig?.terminologyPortalUrl || "https://term.tilde.com";
3520
3520
  this._termConfig.canCreateCollection = termConfig?.canCreateCollection;
3521
3521
  this._termConfig.isCollectionsActivated = termConfig?.isCollectionsActivated;
3522
3522
  this._termConfig.isTermPortalSupported = termConfig?.isTermPortalSupported ?? false;
@@ -5758,12 +5758,6 @@ class CombinedCollection {
5758
5758
  get mtStatus() {
5759
5759
  return this.mtCollection?.status;
5760
5760
  }
5761
- /**
5762
- * Last updated date from mt api.
5763
- */
5764
- get lastUpdated() {
5765
- return this.mtCollection?.lastUpdated;
5766
- }
5767
5761
  /**
5768
5762
  * Collection name. If has term collection, takes from there. If not, then returns mt collection name.
5769
5763
  */
@@ -5833,7 +5827,7 @@ class CombinedCollection {
5833
5827
  */
5834
5828
  deleteTerms() {
5835
5829
  this.termCollection = null;
5836
- this.update(null);
5830
+ this.update(null, false);
5837
5831
  }
5838
5832
  /**
5839
5833
  * Deletes mt collection and its properties.
@@ -5850,6 +5844,7 @@ class CombinedCollection {
5850
5844
  if (termModified && lastMtUpdated) {
5851
5845
  isSynchronized = termModified < lastMtUpdated;
5852
5846
  }
5847
+ this.lastUpdated = termModified ?? lastMtUpdated;
5853
5848
  this._isSynchronized = isSynchronized;
5854
5849
  }
5855
5850
  updateSource() {
@@ -5885,7 +5880,7 @@ class TermApiService {
5885
5880
  this.http = http;
5886
5881
  }
5887
5882
  get url() {
5888
- return `${this.config.termConfig.apiUrl}/api/termservice/collection`;
5883
+ return `${this.config.termConfig.terminologyPortalUrl}/api/termservice/collection`;
5889
5884
  }
5890
5885
  createCollection(defaultLanguages, collectionName) {
5891
5886
  const params = {
@@ -5908,7 +5903,7 @@ class TermApiService {
5908
5903
  }));
5909
5904
  }
5910
5905
  getEditLink(termId, sourceLanguage, targetLanguage) {
5911
- let link = `${this.config.termConfig.apiUrl}/collections/${termId}/mt`;
5906
+ let link = `${this.config.termConfig.terminologyPortalUrl}/collections/${termId}/mt`;
5912
5907
  if (sourceLanguage) {
5913
5908
  link = `${link}/${sourceLanguage}`;
5914
5909
  }
@@ -8443,9 +8438,7 @@ class TldTranslateTextComponent {
8443
8438
  maxLength: this.config.audioConfig.maximumRecordTime,
8444
8439
  apiUrl: this.config.audioConfig.dictateApiUrl
8445
8440
  };
8446
- this.allowedTypesWithoutDots = [];
8447
- this.allowedFileTypes.forEach(el => this.allowedTypesWithoutDots.push(el.replace(".", "")));
8448
- this.visibleExtensions = this.capitalizeFirstLetter(this.allowedTypesWithoutDots.slice(0, this.visibleExtensionCount).join(", "));
8441
+ this.visibleExtensions = this.allowedFileTypes.slice(0, this.visibleExtensionCount).join(", ");
8449
8442
  this.maxSizeMB = Common.bytesToMb(this.config.fileConfig.maxSize);
8450
8443
  this.tldSystem.getActiveData().pipe(distinctUntilChanged((x, y) => x && y && x.systemId == y.systemId))
8451
8444
  .pipe(takeUntil(this.destroy$))
@@ -8474,9 +8467,6 @@ class TldTranslateTextComponent {
8474
8467
  }
8475
8468
  this.subscribeToBreakpointObserver();
8476
8469
  }
8477
- capitalizeFirstLetter(s) {
8478
- return s && s[0].toUpperCase() + s.slice(1);
8479
- }
8480
8470
  copy() {
8481
8471
  this.clipboard.copy(this.translatedText);
8482
8472
  this.alerts.info("TLD_TRANSLATE.TEXT_COPIED", { id: this.copyMessageId, closeButtonId: this.copyMessageCloseButtonId, parentId: this.copyButtonId });
@@ -10408,7 +10398,7 @@ class MtTermV2Service {
10408
10398
  default: collection.editables.default,
10409
10399
  scope: collection.editables.scope
10410
10400
  };
10411
- return this.engineTermApi.update(engineId, collection.termId, params)
10401
+ return this.engineTermApi.update(engineId, collection.mtCollection.id, params)
10412
10402
  .pipe(map(collection => this.convertToCombinedCollection(collection)));
10413
10403
  }
10414
10404
  }