1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-03 16:38:31 +00:00

4.0.0-rc4.5

* Added: Whisper Support
* Fixed: UI missing hover state for a few elements added by FrankerFaceZ.
* Fixed: Handle missing badge definition when rendering FFZ badges.
* Fixed: Update static chat message type mappings.
* Fixed: Error in metadata when unable to get the proper player.
* Fixed: Incorrectly applying dark theme to products page.

A bit more work on getting enhanced viewer cards ready.
This commit is contained in:
SirStendec 2018-07-13 14:32:12 -04:00
parent 4a326823b9
commit 17fb41f083
26 changed files with 396 additions and 80 deletions

View file

@ -135,9 +135,11 @@ export class TranslationManager extends Module {
}
onEnable() {
this._ = new TranslationCore; /*({
awarn: (...args) => this.log.info(...args)
});*/
this._ = new TranslationCore({
formatters: {
'humanTime': n => this.toHumanTime(n)
}
});
this._.transformation = TRANSFORMATIONS[this.settings.get('i18n.debug.transform')];
this.locale = this.settings.get('i18n.locale');
@ -162,6 +164,9 @@ export class TranslationManager extends Module {
toHumanTime(duration, factor = 1) {
// TODO: Make this better. Make all time handling better in fact.
if ( duration instanceof Date )
duration = (Date.now() - duration.getTime()) / 1000;
duration = Math.floor(duration);
const years = Math.floor((duration * factor) / 31536000) / factor;