perForumStats: add strings localization
Bug: twpowertools:95
Change-Id: I98bd6d3d51fbd4ff4706eab596a8dd895de28f14
diff --git a/src/contentScripts/communityConsole/extraInfo.js b/src/contentScripts/communityConsole/extraInfo.js
index b78b2d0..8419ea2 100644
--- a/src/contentScripts/communityConsole/extraInfo.js
+++ b/src/contentScripts/communityConsole/extraInfo.js
@@ -6,6 +6,7 @@
import {createPlainTooltip} from '../../common/tooltip.js';
import {createExtBadge, getDisplayLanguage} from './utils/common.js';
+import PerForumStatsSection from './utils/PerForumStatsSection.js';
const kViewUnifiedUserResponseEvent = 'TWPT_ViewUnifiedUserResponse';
const kListCannedResponsesResponse = 'TWPT_ListCannedResponsesResponse';
@@ -719,13 +720,8 @@
timeout: 15 * 1000,
})
.then(profile => {
- const message = {
- action: 'injectPerForumStatsSection',
- prefix: 'TWPT-extrainfo',
- profile: profile.body,
- locale: this.displayLanguage,
- };
- window.postMessage(message, '*');
+ new PerForumStatsSection(
+ chart?.parentNode, profile.body, this.displayLanguage);
})
.catch(err => {
console.error(