We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40b6a7b commit bfcc01eCopy full SHA for bfcc01e
1 file changed
src/base/translate/fixStats.js
@@ -0,0 +1,11 @@
1
+import eventManager from '../../utils/eventManager.js';
2
+
3
+eventManager.on('translation:loaded', () => {
4
+ const CLASSES = ['cost-color', 'atk-color', 'hp-color'];
5
+ $.extend($.i18n.parser.emitter, {
6
+ stats: (nodes) => CLASSES
7
+ .slice(Math.max(0, 3 - nodes.length))
8
+ .map((clazz, i) => nodes[i].replace(/\d+/, `<span class="${clazz}">$&</span>`))
9
+ .join('/'),
10
+ });
11
+});
0 commit comments