1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/wizard/helpers/char-counter.js.es6

10 Zeilen
437 B
Text

import { registerUnbound } from "discourse-common/lib/helpers";
import I18n from "I18n";
export default registerUnbound("char-counter", function(body) {
let bodyLength = body ? body.length : 0;
let characterString = bodyLength == 1 ? 'wizard.character' : 'wizard.characters';
let finalString = `<div class="body-length">${bodyLength} ${ I18n.t(characterString)}</div>`;
return new Handlebars.SafeString(finalString);
2021-01-08 07:54:51 +01:00
});