Add better support for translations with backwards compatibility

This commit is contained in:
Mikko Tapionlinna
2017-04-25 23:15:34 +03:00
parent a6485b61a4
commit ee88897b18
4 changed files with 38 additions and 14 deletions

View File

@@ -265,7 +265,12 @@ Module.register("calendar", {
}
}
} else {
timeWrapper.innerHTML = this.capFirst(this.translate("RUNNING")) + " " + moment(event.endDate, "x").fromNow(true);
timeWrapper.innerHTML = this.capFirst(
this.translate("RUNNING", {
fallback: this.translate("RUNNING") + " {timeUntilEnd}",
timeUntilEnd: moment(event.endDate, "x").fromNow(true)
})
);
}
}
//timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll');