@zeesoft/i18n-verify 1.0.0 → 2.0.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.
@@ -40,6 +40,9 @@ class Config {
40
40
  static getGarbledChars() {
41
41
  return [...(this.#options.garbledChars || []), ..._constants.GARBLED_CHARACTERS];
42
42
  }
43
+ static getL10nReportsPath() {
44
+ return this.#options.l10nReportsPath;
45
+ }
43
46
  static setDriver(driver) {
44
47
  this.#driver = driver;
45
48
  }
@@ -12,6 +12,7 @@ const getConfigTemplate = (type = '') => `{
12
12
  "type": "${type}", // set automation framework type ${(0, _common.arr2Txt)(Object.values(_constants.SYSTEM_TYPES))}
13
13
  "qaLocale": "", // set the qa locale used in your project
14
14
  "l10nResourcePath": "./l10nResources", // set the dir path of l10n resources
15
+ "l10nReportsPath": "./l10nReports/", // set the dir path of l10n reports
15
16
  "supportedLocales": ["en_US", "fr_FR", "ja_JP"], // set the list of supported locales
16
17
  "defaultLocale": "en_US", // set default locale of the application
17
18
  "qaMock": { // set the prefix and suffix characters of qa locale
@@ -48,7 +49,7 @@ const validateConfig = config => {
48
49
 
49
50
  // add required property validations
50
51
  const missingKeys = [];
51
- if (!(0, _common.allPropertyExists)(['l10nResourcePath', 'supportedLocales', 'defaultLocale', 'type'], config, missingKeys)) {
52
+ if (!(0, _common.allPropertyExists)(['l10nResourcePath', 'l10nReportsPath', 'supportedLocales', 'defaultLocale', 'type'], config, missingKeys)) {
52
53
  throw new Error(`following properties are missing in ${_constants.CONFIG_FILE_NAME} file: ${(0, _common.arr2Txt)(missingKeys)}`);
53
54
  }
54
55
  if (!Object.values(_constants.SYSTEM_TYPES).includes(config?.type || '')) {
@@ -10,7 +10,7 @@ var _logs = _interopRequireDefault(require("../../logs.js"));
10
10
  var _base = _interopRequireDefault(require("../base.js"));
11
11
  var _css = require("./template/css.js");
12
12
  var _html = require("./template/html.js");
13
- var _javascript = require("./template/javascript.js");
13
+ var _index = _interopRequireDefault(require("./template/javascript/index.js"));
14
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  class HtmlReport extends _base.default {
16
16
  constructor() {
@@ -18,9 +18,9 @@ class HtmlReport extends _base.default {
18
18
  }
19
19
  buildContent() {
20
20
  const metaInfo = this.getMetaInfo();
21
- const script = (0, _javascript.getJsData)(metaInfo);
21
+ const script = (0, _index.default)(metaInfo);
22
22
  const style = (0, _css.getCssData)();
23
- const body = (0, _html.getBodyData)(metaInfo);
23
+ const body = (0, _html.getBodyData)();
24
24
  return (0, _html.renderHtml)({
25
25
  appName: metaInfo.appName,
26
26
  reportTime: metaInfo.reportTime,
@@ -6,14 +6,18 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getCssData = void 0;
7
7
  const getCssData = () => `
8
8
  * {
9
- user-select: none;
10
- }
9
+ user-select: none;
10
+ }
11
11
 
12
12
  body {
13
13
  margin: 0;
14
14
  display: flex;
15
15
  flex-direction: column;
16
16
  font-family: Arial, sans-serif;
17
+ font-family: "Helvetica Neue", Arial, sans-serif;
18
+ -webkit-font-smoothing: antialiased; /* Webkit-based browsers */
19
+ -moz-osx-font-smoothing: grayscale; /* Firefox on OS X */
20
+ font-smooth: always; /* Non-standard, some browsers */
17
21
  }
18
22
 
19
23
  header {
@@ -29,7 +33,7 @@ const getCssData = () => `
29
33
  }
30
34
 
31
35
  .sidebar {
32
- width: 250px;
36
+ width: 16rem;
33
37
  height: 100%;
34
38
  background-color: #333;
35
39
  color: #fff;
@@ -77,7 +81,13 @@ const getCssData = () => `
77
81
  }
78
82
 
79
83
  .menu-item.has-submenu > a::after {
80
- content: '▼';
84
+ content: "⯆";
85
+ float: right;
86
+ margin-left: 5px;
87
+ }
88
+
89
+ .menu-item.has-submenu.selected > a::after {
90
+ content: "⯅";
81
91
  float: right;
82
92
  margin-left: 5px;
83
93
  }
@@ -86,6 +96,10 @@ const getCssData = () => `
86
96
  background-color: #555;
87
97
  }
88
98
 
99
+ .submenu .sub-menu-item {
100
+ margin: 3px auto;
101
+ }
102
+
89
103
  .submenu .sub-menu-item a:hover {
90
104
  background-color: #777;
91
105
  }
@@ -99,10 +113,11 @@ const getCssData = () => `
99
113
  }
100
114
 
101
115
  .content-wrapper {
102
- padding: 20px;
116
+ padding: 1rem;
103
117
  float: left;
104
- width: calc(100% - 250px);
118
+ width: calc(100% - 16rem);
105
119
  background-color: #f4f4f4;
120
+ overflow: hidden;
106
121
  }
107
122
 
108
123
  .content {
@@ -112,21 +127,287 @@ const getCssData = () => `
112
127
  .content .title {
113
128
  font-size: 1rem;
114
129
  color: #080404e2;
130
+ font-weight: 600;
115
131
  }
116
132
 
117
133
  .content .title::after {
118
- content: ':';
134
+ content: ":";
119
135
  }
120
136
 
121
137
  .content.active {
122
138
  display: flex !important;
123
139
  flex-direction: column;
140
+ gap: 0.9rem;
141
+ flex-wrap: wrap;
142
+ transition: all 2s ease-in-out;
143
+ }
144
+
145
+ .sidebar .footer {
146
+ bottom: 5px;
147
+ position: absolute;
148
+ font-size: 12.4px;
149
+ color: #14cf96;
150
+ font-family: system-ui;
151
+ }
152
+
153
+ #overview {
154
+ flex-direction: row;
155
+ justify-content: space-between;
156
+ }
157
+
158
+ #overview .card {
159
+ display: flex;
160
+ flex-direction: column;
161
+ width: 25rem;
162
+ height: 12.5rem;
163
+ border: 1px solid #ddd;
164
+ box-shadow: 0 22px 35px -16px rgba(0, 0, 0, 0.3);
165
+ border-radius: 5px;
166
+ background: white;
167
+ padding: 1rem;
168
+ }
169
+
170
+ #overview .overall-quality {
171
+ height: 20rem;
172
+ flex-basis: 100%;
173
+ line-height: 14px;
174
+ }
175
+
176
+ #overview .overall-quality .section {
177
+ display: flex;
178
+ flex-direction: row;
179
+ }
180
+
181
+ #overview .overall-quality .section .block {
182
+ width: 50%;
183
+ }
184
+
185
+ #overview .overall-quality .section .block article {
186
+ padding: 5px;
187
+ }
188
+
189
+ #overview .overall-quality .section .block article p.desc {
190
+ font-size: 0.9em;
191
+ }
192
+
193
+ #overview .overall-quality .section .block article .items li {
194
+ font-size: 0.87em;
195
+ }
196
+
197
+ #overview .overall-quality .section .block article .items li .detail {
198
+ margin-top: -10px;
199
+ }
200
+
201
+ #overview .overall-quality .section .block .graph {
202
+ margin-top: 1.5em;
203
+ }
204
+
205
+ #overview .string-quality,
206
+ #overview .number-quality,
207
+ #overview .datetime-quality,
208
+ #overview .skipped-items {
209
+ flex-basis: 45%;
210
+ }
211
+
212
+ #overview .string-quality .graph,
213
+ #overview .number-quality .graph,
214
+ #overview .datetime-quality .graph,
215
+ #overview .skipped-items .graph {
216
+ align-self: center;
217
+ }
218
+
219
+ #overview .string-quality .graph {
220
+ margin-left: 4rem;
221
+ }
222
+
223
+ #overview .number-quality.card,
224
+ #overview .datetime-quality.card {
225
+ height: 13rem;
226
+ }
227
+
228
+ #overview .number-quality .graph,
229
+ #overview .datetime-quality .graph {
230
+ margin-top: -0.9rem;
231
+ margin-left: 4.5rem;
232
+ }
233
+
234
+ #insights .cards {
235
+ display: flex;
236
+ flex-direction: column;
237
+ gap: 1.5rem;
238
+ }
239
+
240
+ #insights .cards .holder {
241
+ display: flex;
242
+ flex-direction: row;
243
+ gap: 1.5rem;
244
+ flex-wrap: wrap;
245
+ }
246
+
247
+ #insights .cards .card {
248
+ display: flex;
249
+ flex-direction: column;
250
+ width: 20rem;
251
+ min-height: 10rem;
252
+ border: 1px solid #ddd;
253
+ box-shadow: 0 22px 35px -16px rgba(0, 0, 0, 0.3);
254
+ border-radius: 5px;
255
+ background: white;
256
+ }
257
+
258
+ #insights .cards .card:hover {
259
+ transform: scale(1.015);
260
+ box-shadow: 0 22px 35px -16px #07ff7d33;
261
+ cursor: pointer;
262
+ transition: all 0.1s ease-in-out;
263
+ }
264
+
265
+ #insights .cards .card .title {
266
+ height: 2.5rem;
267
+ font-size: 1rem;
268
+ padding-top: 1rem;
269
+ font-weight: 500;
270
+ width: calc(100% - 1rem);
271
+ background: #0c5ad9d6;
272
+ border-top-left-radius: 5px;
273
+ border-top-right-radius: 5px;
274
+ padding-left: 1rem;
275
+ color: white;
276
+ }
277
+
278
+ #insights .cards .card .title::after {
279
+ content: "";
280
+ }
281
+
282
+ #insights .cards .card .card-content {
283
+ display: flex;
284
+ flex-direction: column;
124
285
  gap: 1rem;
286
+ padding: 1rem;
287
+ }
288
+
289
+ #insights .cards .card .status-bar {
290
+ display: flex;
291
+ flex-direction: column;
292
+ gap: 0.8rem;
293
+ }
294
+
295
+ #insights .cards .card .status-bar .bar-container .name {
296
+ font-size: 0.78rem;
297
+ -webkit-font-smoothing: antialiased;
298
+ -moz-osx-font-smoothing: grayscale;
299
+ }
300
+
301
+ #insights .cards .card .status-bar .bar-container .name::after {
302
+ content: ":";
303
+ }
304
+
305
+ #insights .cards .card .status-bar .bar-container .bar-holder {
306
+ width: 100%;
307
+ height: 10px;
308
+ border: 1px solid #00000038;
309
+ border-radius: 2px;
310
+ }
311
+
312
+ #insights .cards .card .status-bar .bar-container .bar-holder .bar {
313
+ background-color: #14cf96;
314
+ height: 100%;
315
+ font-size: 0.63rem;
316
+ text-align: right;
317
+ color: white;
318
+ }
319
+
320
+ #insights .cards .card .stat {
321
+ display: flex;
322
+ flex-direction: column;
323
+ gap: 0.3rem;
324
+ border: 0.5px solid #00000012;
325
+ border-radius: 6px;
326
+ }
327
+
328
+ #insights .cards .card .stat table td {
329
+ font-size: 0.78rem;
330
+ -webkit-font-smoothing: antialiased;
331
+ -moz-osx-font-smoothing: grayscale;
332
+ }
333
+
334
+ #insights .cards .card .stat table td.name {
335
+ width: 70%;
336
+ }
337
+
338
+ #insights .cards .card .stat table td.value::before {
339
+ content: ": ";
340
+ }
341
+
342
+ #locale {
343
+ background: white;
344
+ padding: 12px;
345
+ border-radius: 5px;
346
+ padding-top: 20px;
347
+ }
348
+
349
+ #locale .title {
350
+ content: ":";
351
+ }
352
+
353
+ #locale .coverage-info {
354
+ margin-top: 1rem;
355
+ width: 100%;
356
+ height: 80vh;
357
+ padding-right: 1rem;
358
+ padding-left: 0.1rem;
359
+ }
360
+
361
+ #locale table thead th select.filter {
362
+ margin-left: 1rem;
363
+ max-width: 8rem;
364
+ text-overflow: ellipsis;
365
+ }
366
+
367
+ #locale .image-viewer {
368
+ display: none;
369
+ position: fixed;
370
+ z-index: 9999;
371
+ top: 0;
372
+ left: 0;
373
+ width: 100%;
374
+ height: 100%;
375
+ background-color: rgba(0, 0, 0, 0.8);
376
+ text-align: center;
377
+ }
378
+
379
+ #locale .image-container {
380
+ position: relative;
381
+ top: 50%;
382
+ transform: translateY(-50%);
383
+ display: inline-block;
384
+ }
385
+
386
+ #locale .image-viewer img {
387
+ max-width: 90%;
388
+ max-height: 90%;
389
+ }
390
+
391
+ #locale .close-button {
392
+ position: absolute;
393
+ top: 0.5rem;
394
+ right: 1rem;
395
+ color: #ffffffbf;
396
+ font-size: 3.1rem;
397
+ cursor: pointer;
398
+ }
399
+
400
+ #locale .close-button:hover {
401
+ color: white;
402
+ }
403
+
404
+ #locale table td .view-screenshot-btn {
405
+ color: blue;
125
406
  }
126
407
 
127
408
  @media (max-width: 768px) {
128
409
  .sidebar {
129
- width: 100%;
410
+ width: 16rem;
130
411
  padding: 10px;
131
412
  }
132
413
  }`;
@@ -24,6 +24,22 @@ const renderHtml = ({
24
24
  content="I18n verification report"
25
25
  />
26
26
  <title>I18n Verification Report | ${reportTime}</title>
27
+ <!-- 3rd party dependecies -->
28
+ <link
29
+ rel="stylesheet"
30
+ href="https://cdn.datatables.net/2.0.3/css/dataTables.dataTables.min.css"
31
+ />
32
+ <script
33
+ src="https://code.jquery.com/jquery-3.7.1.slim.min.js"
34
+ integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8="
35
+ crossorigin="anonymous"
36
+ defer
37
+ ></script>
38
+ <script src="https://cdn.jsdelivr.net/npm/apexcharts" defer></script>
39
+ <script
40
+ src="https://cdn.datatables.net/2.0.3/js/dataTables.min.js"
41
+ defer
42
+ ></script>
27
43
  <style>
28
44
  ${style}
29
45
  </style>
@@ -37,7 +53,7 @@ const renderHtml = ({
37
53
  </html>
38
54
  `;
39
55
  exports.renderHtml = renderHtml;
40
- const getBodyData = () => ` <header><div class="logo">zI18n-Verify</div></header>
56
+ const getBodyData = () => `<header><div class="logo">zI18n-Verify</div></header>
41
57
  <main>
42
58
  <div class="sidebar">
43
59
  <ul class="menu" id="menu">
@@ -46,33 +62,96 @@ const getBodyData = () => ` <header><div class="logo">zI18n-Verify</div></header
46
62
  </li>
47
63
  <li class="menu-item has-submenu" data-page="insights">
48
64
  <a href="#" data-page="insights">Insights</a>
49
- <ul class="submenu">
50
- <li class="sub-menu-item" data-locale="en_US">
51
- <a href="#">en_US</a>
52
- </li>
53
- <li class="sub-menu-item" data-locale="fr_CA">
54
- <a href="#">fr_CA</a>
55
- </li>
56
- </ul>
65
+ <ul class="submenu"></ul>
57
66
  </li>
58
67
  </ul>
68
+ <div class="footer"></div>
59
69
  </div>
60
70
  <div class="content-wrapper">
61
71
  <div id="overview" class="content">
62
- <div class="overall-quality">
63
- <span class="title">Overall I18n Quality</span>
72
+ <div class="overall-quality card">
73
+ <span class="title">Overall I18n Coverage</span>
74
+ <div class="section">
75
+ <div class="block">
76
+ <article>
77
+ <p class="desc">
78
+ zI18n-Verify report provides a comprehensive information
79
+ about the I18n and L10n quailty of your application.
80
+ </p>
81
+ <ul class="items">
82
+ <li>
83
+ <h4>Reviewed:</h4>
84
+ <p class="detail">
85
+ Total strings which are captured and processed by
86
+ zI18n-Verify.
87
+ </p>
88
+ </li>
89
+ <li>
90
+ <h4>Internationlized:</h4>
91
+ <p class="detail">
92
+ Different types of value like string, number, date-time
93
+ which are properly Internationalized.
94
+ </p>
95
+ </li>
96
+ <li>
97
+ <h4>Not Internationalized:</h4>
98
+ <p class="detail">
99
+ Values which are not Internationalized. Also includes
100
+ Partially Localized strings and Encoding Issues.
101
+ </p>
102
+ </li>
103
+ <li>
104
+ <h4>Skipped:</h4>
105
+ <p class="detail">
106
+ Values which are skipped from processing because they
107
+ are listed in DNT / Ignored lists or contains Auto
108
+ Ignored pattern / User input pattern.
109
+ </p>
110
+ </li>
111
+ </ul>
112
+ </article>
113
+ </div>
114
+ <div class="block">
115
+ <div class="graph"></div>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ <div class="string-quality card">
120
+ <span class="title">String Coverage</span>
121
+ <div class="graph"></div>
122
+ </div>
123
+ <div class="skipped-items card">
124
+ <span class="title">Skipped Items</span>
125
+ <div class="graph"></div>
126
+ </div>
127
+ <div class="number-quality card">
128
+ <span class="title">Number Coverage</span>
129
+ <div class="graph"></div>
130
+ </div>
131
+ <div class="datetime-quality card">
132
+ <span class="title">DateTime Coverage</span>
133
+ <div class="graph"></div>
64
134
  </div>
65
- <div><span class="title">String Quality</span></div>
66
- <div><span class="title">Number Quality</span></div>
67
- <div><span class="title">DateTime Quality</span></div>
68
135
  </div>
69
136
  <div id="insights" class="content">
70
137
  <div class="cards">
71
- <span class="title">Locale wise info cards</span>
138
+ <span class="title">Locale Quality</span>
139
+ <div class="holder"></div>
72
140
  </div>
73
141
  </div>
74
142
  <div id="locale" class="content">
75
- <div class="string-data"><span class="title">String Data</span></div>
143
+ <span class="title">Locale Quality</span>
144
+ <div class="coverage-info">
145
+ <table class="row-border hover order-column stripe"></table>
146
+ </div>
147
+ <div id="imageViewer" class="image-viewer">
148
+ <span class="close-button" onclick="closeImageViewer()"
149
+ >&times;</span
150
+ >
151
+ <div class="image-container">
152
+ <img id="imageView" src="" alt="Image" />
153
+ </div>
154
+ </div>
76
155
  </div>
77
156
  </div>
78
157
  </main>`;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = (locales, stats, statsByLocale) => ``;
8
+ exports.default = _default;