From 35c941d4d0ad17a8e20f67aec04a7bc7f5dd7159 Mon Sep 17 00:00:00 2001 From: gaba Date: Mon, 15 May 2017 16:17:53 -0700 Subject: [PATCH] Add missing translations from commentbox. --- client/coral-i18n/locales/en.yml | 10 ++++++++ client/coral-i18n/locales/es.yml | 10 ++++++++ client/coral-plugin-commentbox/CommentBox.js | 6 ++--- client/coral-plugin-commentbox/CommentForm.js | 13 +++++----- .../coral-plugin-commentbox/translations.json | 24 ------------------- 5 files changed, 29 insertions(+), 34 deletions(-) delete mode 100644 client/coral-plugin-commentbox/translations.json diff --git a/client/coral-i18n/locales/en.yml b/client/coral-i18n/locales/en.yml index 8a9e41514..15ef7b427 100644 --- a/client/coral-i18n/locales/en.yml +++ b/client/coral-i18n/locales/en.yml @@ -14,6 +14,16 @@ comment: ban_user: "Ban User" comment: "Post a comment" flagged: flagged +comment_box: + post: "Post" + cancel: "Cancel" + reply: "Reply" + comment: "Post a comment" + name: "Name" + comment_post_notif: "Your comment has been posted." + comment_post_notif_premod: "Thank you for posting. Our moderation team will review your comment shortly." + comment_post_banned_word: "Your comment contains one or more words that are not permitted, so it will not be published. If you think this message is incorrect, please contact our moderation team." + characters_remaining: "characters remaining" comment_is_best: "This comment is one of the best" comment_offensive: "This comment is offensive" comment_plural: Comments diff --git a/client/coral-i18n/locales/es.yml b/client/coral-i18n/locales/es.yml index 2dbbf83b5..08ebc27ba 100644 --- a/client/coral-i18n/locales/es.yml +++ b/client/coral-i18n/locales/es.yml @@ -14,6 +14,16 @@ comment: ban_user: "Usuario Suspendido" comment: "Publicar un comentario" flagged: reportado +comment_box: + post: "Publicar" + cancel: "Cancelar" + reply: "Responder" + comment: "Publicar un comentario" + name: "Nombre" + comment_post_notif: "Tu comentario ha sido publicado." + comment_post_notif_premod: "Gracias por el comentario. Nuestro equipo de moderación va a revisarlo muy pronto." + comment_post_banned_word: "Tu comentario contiene una o más palabras que no estan permitidas en nuestro espacio, por lo que no será publicado. Si crees que es un error, por favor contacta a nuestro equipo de moderación." + characters_remaining: "carácteres restantes" comment_is_best: Este comentario es uno de los mejores comment_offensive: Este comentario es ofensivo comment_plural: Comentarios diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index 2176ea1a7..a63f31f3f 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -11,9 +11,9 @@ export const name = 'coral-plugin-commentbox'; // if needed export const notifyForNewCommentStatus = (addNotification, status) => { if (status === 'REJECTED') { - addNotification('error', lang.t('comment-post-banned-word')); + addNotification('error', lang.t('comment_box.comment_post_banned_word')); } else if (status === 'PREMOD') { - addNotification('success', lang.t('comment-post-notif-premod')); + addNotification('success', lang.t('comment_box.comment_post_notif-premod')); } }; @@ -156,7 +156,7 @@ class CommentBox extends React.Component { key={this.state.postedCount} defaultValue={this.props.defaultValue} bodyInputId={isReply ? 'replyText' : 'commentText'} - bodyLabel={isReply ? lang.t('reply') : lang.t('comment.comment')} + bodyLabel={isReply ? lang.t('comment_box.reply') : lang.t('comment.comment')} maxCharCount={maxCharCount} charCountEnable={this.props.charCountEnable} bodyPlaceholder={lang.t('comment.comment')} diff --git a/client/coral-plugin-commentbox/CommentForm.js b/client/coral-plugin-commentbox/CommentForm.js index 5dc52af4f..1caf2fb10 100644 --- a/client/coral-plugin-commentbox/CommentForm.js +++ b/client/coral-plugin-commentbox/CommentForm.js @@ -2,12 +2,11 @@ import React, {PropTypes} from 'react'; import {Button} from 'coral-ui'; import classnames from 'classnames'; import {I18n} from '../coral-framework'; -import translations from './translations.json'; import Slot from 'coral-framework/components/Slot'; import {name} from './CommentBox'; -const lang = new I18n(translations); +const lang = new I18n(); /** * Common UI for Creating or Editing a Comment @@ -56,9 +55,9 @@ export class CommentForm extends React.Component { } static get defaultProps() { return { - bodyLabel: lang.t('comment'), - bodyPlaceholder: lang.t('comment'), - submitText: lang.t('post'), + bodyLabel: lang.t('comment_box.comment'), + bodyPlaceholder: lang.t('comment_box.comment'), + submitText: lang.t('comment_box.post'), saveButtonCStyle: 'darkGrey', saveCommentEnabled: () => true, }; @@ -109,7 +108,7 @@ export class CommentForm extends React.Component { { this.props.charCountEnable &&
maxCharCount ? `${name}-char-max` : ''}`}> - {maxCharCount && `${maxCharCount - length} ${lang.t('characters-remaining')}`} + {maxCharCount && `${maxCharCount - length} ${lang.t('comment_box.characters_remaining')}`}
}
@@ -120,7 +119,7 @@ export class CommentForm extends React.Component { cStyle='darkGrey' className={classnames(`${name}-cancel-button`, buttonClass)} onClick={this.props.cancelButtonClicked}> - {lang.t('cancel')} + {lang.t('comment_box.cancel')} ) } diff --git a/client/coral-plugin-commentbox/translations.json b/client/coral-plugin-commentbox/translations.json deleted file mode 100644 index 4110df75d..000000000 --- a/client/coral-plugin-commentbox/translations.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "en": { - "post": "Post", - "cancel": "Cancel", - "reply": "Reply", - "comment": "Post a comment", - "name": "Name", - "comment-post-notif": "Your comment has been posted.", - "comment-post-notif-premod": "Thank you for posting. Our moderation team will review your comment shortly.", - "comment-post-banned-word": "Your comment contains one or more words that are not permitted, so it will not be published. If you think this message is incorrect, please contact our moderation team.", - "characters-remaining": " characters remaining" - }, - "es": { - "post": "Publicar", - "cancel": "Cancelar", - "reply": "Responder", - "comment": "Publicar un comentario", - "name": "Nombre", - "comment-post-notif": "Tu comentario ha sido publicado.", - "comment-post-notif-premod": "Gracias por el comentario. Nuestro equipo de moderación va a revisarlo muy pronto.", - "comment-post-banned-word": "Tu comentario contiene una o más palabras que no estan permitidas en nuestro espacio, por lo que no será publicado. Si crees que es un error, por favor contacta a nuestro equipo de moderación.", - "characters-remaining": "carácteres restantes" - } -}