diff --git a/common/static/common/templates/discussion/thread-show.underscore b/common/static/common/templates/discussion/thread-show.underscore index 6c3fba6465..3caf6cbccd 100644 --- a/common/static/common/templates/discussion/thread-show.underscore +++ b/common/static/common/templates/discussion/thread-show.underscore @@ -25,16 +25,17 @@ {created_at: created_at}, true ); + var postedTimeAgoMessage; + // Using a separate message to ensure proper translation for different languages + // thread_type describes the kind of post this is (e.g. "question" or "discussion"); + // time_ago is how much time has passed since the post was created (e.g. "4 hours ago") + if (thread_type === 'discussion') { + postedTimeAgoMessage = gettext('discussion posted %(time_ago)s by %(author)s'); + } else { + postedTimeAgoMessage = gettext('question posted %(time_ago)s by %(author)s'); + } %> - <%= - interpolate( - // Translators: post_type describes the kind of post this is (e.g. "question" or "discussion"); - // time_ago is how much time has passed since the post was created (e.g. "4 hours ago") - _.escape(gettext('%(post_type)s posted %(time_ago)s by %(author)s')), - {post_type: thread_type, time_ago: timeAgoHtml, author: author_display}, - true - ) - %> + <%= interpolate(_.escape(postedTimeAgoMessage), {time_ago: timeAgoHtml, author: author_display}, true) %>