Translate discussion in discussion posted 1s ago by X

This commit is contained in:
Omar Al-Ithawi
2017-04-13 17:05:35 +03:00
parent be5c4fad8b
commit b0e6242d97

View File

@@ -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) %>
</p>
<div class="post-labels">
<span class="post-label post-label-pinned">