Translate, pep up notifications

This commit is contained in:
Chi Vinh Le
2017-06-20 01:38:38 +07:00
parent 8dbc17c8d9
commit 523f23269b
6 changed files with 18 additions and 6 deletions
@@ -207,6 +207,7 @@
.toastify__body {
color: white;
overflow-x: scroll;
font-size: 15px;
font-weight: 400;
}
@@ -95,7 +95,7 @@ class Comment extends React.Component {
</span>
{
(comment.editing && comment.editing.edited)
? <span>&nbsp;<span className={styles.editedMarker}>(Edited)</span></span>
? <span>&nbsp;<span className={styles.editedMarker}>({t('comment.edited')})</span></span>
: null
}
{props.currentUserId !== comment.user.id &&
@@ -34,6 +34,10 @@ import {Spinner} from 'coral-ui';
import Moderation from '../components/Moderation';
import Comment from './Comment';
function prepareNotificationText(text) {
return truncate(text, {length: 50}).replace('\n', ' ');
}
class ModerationContainer extends Component {
subscriptions = [];
@@ -50,7 +54,7 @@ class ModerationContainer extends Component {
? {}
: {
activeQueue: this.activeTab,
text: `${user.username} accepted comment "${truncate(comment.body, {lenght: 50})}"`,
text: t('modqueue.notify_accepted', user.username, prepareNotificationText(comment.body)),
anyQueue: false,
};
return handleCommentChange(prev, comment, sort, notify);
@@ -67,7 +71,7 @@ class ModerationContainer extends Component {
? {}
: {
activeQueue: this.activeTab,
text: `${user.username} rejected comment "${truncate(comment.body, {lenght: 50})}"`,
text: t('modqueue.notify_rejected', user.username, prepareNotificationText(comment.body)),
anyQueue: false,
};
return handleCommentChange(prev, comment, sort, notify);
@@ -81,7 +85,7 @@ class ModerationContainer extends Component {
const sort = this.props.moderation.sortOrder;
const notify = {
activeQueue: this.activeTab,
text: `${comment.user.username} edited comment to "${truncate(comment.body, {lenght: 50})}"`,
text: t('modqueue.notify_edited', comment.user.username, prepareNotificationText(comment.body)),
anyQueue: false,
};
return handleCommentChange(prev, comment, sort, notify);
@@ -96,7 +100,7 @@ class ModerationContainer extends Component {
const sort = this.props.moderation.sortOrder;
const notify = {
activeQueue: this.activeTab,
text: `${user.username} flagged comment "${truncate(comment.body, {lenght: 50})}"`,
text: t('modqueue.notify_flagged', user.username, prepareNotificationText(comment.body)),
anyQueue: true,
};
return handleCommentChange(prev, comment, sort, notify);
@@ -26,6 +26,7 @@ import Slot from 'coral-framework/components/Slot';
import IgnoredCommentTombstone from './IgnoredCommentTombstone';
import {EditableCommentContent} from './EditableCommentContent';
import {getActionSummary, iPerformedThisAction} from 'coral-framework/utils';
import t from 'coral-framework/services/i18n';
const isStaff = (tags) => !tags.every((t) => t.tag.name !== 'STAFF');
const hasTag = (tags, lookupTag) => !!tags.filter((t) => t.tag.name === lookupTag).length;
@@ -415,7 +416,7 @@ export default class Comment extends React.Component {
<PubDate created_at={comment.created_at} className={'talk-stream-comment-published-date'} />
{
(comment.editing && comment.editing.edited)
? <span>&nbsp;<span className={styles.editedMarker}>(Edited)</span></span>
? <span>&nbsp;<span className={styles.editedMarker}>({t('comment.edited')})</span></span>
: null
}
</span>
+5
View File
@@ -13,6 +13,7 @@ en:
anon: "Anonymous"
ban_user: "Ban User"
comment: "Post a comment"
edited: Edited
flagged: "flagged"
view_context: "View context"
comment_box:
@@ -241,6 +242,10 @@ en:
actions: Actions
all: all
all_streams: "All Streams"
notify_edited: '{0} edited comment "{1}"'
notify_accepted: '{0} accepted comment "{1}"'
notify_rejected: '{0} rejected comment "{1}"'
notify_flagged: '{0} flagged comment "{1}"'
approve: "Approve"
approved: "Approved"
ban_user: "Ban"
+1
View File
@@ -13,6 +13,7 @@ es:
anon: Anónimo
ban_user: "Usuario Suspendido"
comment: "Publicar un comentario"
edited: Editado
flagged: reportado
view_context: "Ver contexto"
comment_box: