diff --git a/assets/javascripts/wizard/helpers/char-counter.js.es6 b/assets/javascripts/wizard/helpers/char-counter.js.es6 index b488d409..4cc12463 100644 --- a/assets/javascripts/wizard/helpers/char-counter.js.es6 +++ b/assets/javascripts/wizard/helpers/char-counter.js.es6 @@ -1,9 +1,16 @@ import { registerUnbound } from "discourse-common/lib/helpers"; import I18n from "I18n"; -export default registerUnbound("char-counter", function(body) { +export default registerUnbound("char-counter", function(body, maxLength) { let bodyLength = body ? body.length : 0; - let characterString = bodyLength == 1 ? 'wizard.character' : 'wizard.characters'; - let finalString = `
${bodyLength} ${ I18n.t(characterString)}
`; + let length = maxLength || bodyLength; + let characterString = length == 1 ? 'wizard.character' : 'wizard.characters'; + let finalString; + + if(maxLength) { + finalString = `
${bodyLength} / ${maxLength} ${ I18n.t(characterString)}
`; + } else { + finalString = `
${bodyLength} ${ I18n.t(characterString)}
`; + } return new Handlebars.SafeString(finalString); });