@adminforth/i18n 1.2.0-next.2 → 1.2.1-next.1

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.
package/dist/index.js CHANGED
@@ -536,10 +536,14 @@ ${JSON.stringify(strings.reduce((acc, s) => {
536
536
  yield this.adminforth.resource(this.resourceConfig.resourceId).update(strId, Object.assign(Object.assign({}, updates), { [this.options.completedFieldName]: futureCompletedFieldValue }));
537
537
  })));
538
538
  for (const lang of langsInvolved) {
539
- yield this.cache.clear(`${this.resourceConfig.resourceId}:frontend:${lang}`);
539
+ const categoriesInvolved = new Set();
540
540
  for (const { enStr, category } of Object.values(updateStrings)) {
541
+ categoriesInvolved.add(category);
541
542
  yield this.cache.clear(`${this.resourceConfig.resourceId}:${category}:${lang}:${enStr}`);
542
543
  }
544
+ for (const category of categoriesInvolved) {
545
+ yield this.cache.clear(`${this.resourceConfig.resourceId}:${category}:${lang}`);
546
+ }
543
547
  }
544
548
  return new Set(totalTranslated).size;
545
549
  });
package/index.ts CHANGED
@@ -647,14 +647,17 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
647
647
  );
648
648
 
649
649
  for (const lang of langsInvolved) {
650
- await this.cache.clear(`${this.resourceConfig.resourceId}:frontend:${lang}`);
650
+ const categoriesInvolved = new Set();
651
651
  for (const { enStr, category } of Object.values(updateStrings)) {
652
+ categoriesInvolved.add(category);
652
653
  await this.cache.clear(`${this.resourceConfig.resourceId}:${category}:${lang}:${enStr}`);
653
654
  }
655
+ for (const category of categoriesInvolved) {
656
+ await this.cache.clear(`${this.resourceConfig.resourceId}:${category}:${lang}`);
657
+ }
654
658
  }
655
659
 
656
660
  return new Set(totalTranslated).size;
657
-
658
661
  }
659
662
 
660
663
  async processExtractedMessages(adminforth: IAdminForth, filePath: string) {
@@ -703,7 +706,6 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
703
706
  process.env.HEAVY_DEBUG && console.log('🪲🔔messagesFile add', messagesFile);
704
707
  this.processExtractedMessages(adminforth, messagesFile);
705
708
  });
706
-
707
709
  }
708
710
 
709
711
  validateConfigAfterDiscover(adminforth: IAdminForth, resourceConfig: AdminForthResource) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "1.2.0-next.2",
3
+ "version": "1.2.1-next.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",