diff --git a/client/coral-admin/public/translations/en.json b/client/coral-admin/public/translations/en.json deleted file mode 100644 index 591de1754..000000000 --- a/client/coral-admin/public/translations/en.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "modqueue": { - "pending": "pending", - "rejected": "rejected", - "flagged": "flagged", - "shortcuts": "Shortcuts", - "close": "Close", - "actions": "Actions", - "navigation": "Navigation", - "approve": "Approve comment", - "reject": "Reject comment", - "nextcomment": "Go to the next comment", - "prevcomment": "Go to the previous comment", - "singleview": "Toggle single comment edit view", - "thismenu": "Open this menu" - }, - "comment": { - "flagged": "flagged", - "anon": "Anonymous" - }, - "embedlink": { - "copy": "Copy to Clipboard" - } -} diff --git a/client/coral-admin/public/translations/es.json b/client/coral-admin/public/translations/es.json deleted file mode 100644 index d151cf13c..000000000 --- a/client/coral-admin/public/translations/es.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "modqueue": { - "pending": "pendiente", - "rejected": "rechazado", - "flagged": "marcado", - "shortcuts": "Atajos de teclado", - "close": "Cerrar" - }, - "comment": { - "flagged": "marcado", - "anon": "Anónimo" - } -} diff --git a/client/coral-plugin-comment-count/CommentCount.js b/client/coral-plugin-comment-count/CommentCount.js index b0d7312e2..47f00ffb5 100644 --- a/client/coral-plugin-comment-count/CommentCount.js +++ b/client/coral-plugin-comment-count/CommentCount.js @@ -1,5 +1,6 @@ import React from 'react'; - +import {I18n} from '../coral-framework'; +import translations from './translations.json'; const name = 'coral-plugin-comment-count'; const CommentCount = ({items, id}) => { @@ -15,9 +16,11 @@ const CommentCount = ({items, id}) => { } } - return
- {`${count } ${ count === 1 ? 'Comment' : 'Comments'}`} + return
+ {`${count} ${count === 1 ? lang.t('comment') : lang.t('comment-plural')}`}
; }; export default CommentCount; + +const lang = new I18n(translations); diff --git a/client/coral-plugin-comment-count/translations.json b/client/coral-plugin-comment-count/translations.json new file mode 100644 index 000000000..f212810e9 --- /dev/null +++ b/client/coral-plugin-comment-count/translations.json @@ -0,0 +1,10 @@ +{ + "en": { + "comment": "Comment", + "comment-plural": "Comments" + }, + "es": { + "comment": "Comentario", + "comment-plural": "Comentarios" + } +} diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index 2fb097610..9032ad328 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -1,5 +1,6 @@ import React, {Component, PropTypes} from 'react'; import {I18n} from '../coral-framework'; +import translations from './translations.json'; const name = 'coral-plugin-commentbox'; @@ -39,7 +40,7 @@ class CommentBox extends Component { postItem(comment, 'comments') .then((comment_id) => { if (premod === 'pre') { - addNotification('success', 'Your comment has been posted and is being reviewed by our moderation team.'); + addNotification('success', lang.t('comment-post-notif-premod')); } else { appendItemArray(parent_id || id, related, comment_id, !parent_id, parent_type); addNotification('success', 'Your comment has been posted.'); @@ -59,7 +60,7 @@ class CommentBox extends Component { style={styles && styles.textarea} value={this.state.username} id={reply ? 'replyUser' : 'commentUser'} - placeholder='Name' + placeholder={lang.t('name')} onChange={(e) => this.setState({username: e.target.value})}/>
this.setState({body: e.target.value})} rows={3}/> @@ -93,15 +94,4 @@ class CommentBox extends Component { export default CommentBox; -const lang = new I18n({ - en: { - post: 'Post', - reply: 'Reply', - comment: 'Comment', - }, - es: { - post: 'Publicar', - reply: 'Respuesta', - comment: 'Comentario' - } -}); +const lang = new I18n(translations); diff --git a/client/coral-plugin-commentbox/translations.json b/client/coral-plugin-commentbox/translations.json new file mode 100644 index 000000000..e8eb8ad52 --- /dev/null +++ b/client/coral-plugin-commentbox/translations.json @@ -0,0 +1,18 @@ +{ + "en": { + "post": "Post", + "reply": "Reply", + "comment": "Comment", + "name": "Name", + "comment-post-notif": "Your comment has been posted.", + "comment-post-notif-premod": "Thank you for reporting this comment. Our moderation team has been notified and will review it shortly." + }, + "es": { + "post": "Publicar", + "reply": "Respuesta", + "comment": "Comentario", + "name": "Nombre", + "comment-post-notif": "¡traduceme!", + "comment-post-notif-premod": "¡traduceme!" + } +} diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/FlagButton.js index eeeb5e3f5..4f90dfb7c 100644 --- a/client/coral-plugin-flags/FlagButton.js +++ b/client/coral-plugin-flags/FlagButton.js @@ -1,4 +1,6 @@ import React from 'react'; +import {I18n} from '../coral-framework'; +import translations from './translations.json'; const name = 'coral-plugin-flags'; @@ -10,7 +12,7 @@ const FlagButton = ({flag, id, postAction, addItem, updateItem, addNotification} addItem({...action, current_user:true}, 'actions'); updateItem(action.item_id, action.action_type, action.id, 'comments'); }); - addNotification('success', 'Thank you for reporting this comment. Our moderation team has been notified and will review it shortly.'); + addNotification('success', lang.t('flag-notif')); }; return
@@ -20,8 +22,8 @@ const FlagButton = ({flag, id, postAction, addItem, updateItem, addNotification} aria-hidden={true}>flag { flagged - ? Flagged - : Flag + ? {lang.t('flag')} + : {lang.t('flagged')} }
; @@ -37,3 +39,5 @@ const styles = { color: 'inherit' } }; + +const lang = new I18n(translations); diff --git a/client/coral-plugin-flags/translations.json b/client/coral-plugin-flags/translations.json new file mode 100644 index 000000000..28eb9f8cb --- /dev/null +++ b/client/coral-plugin-flags/translations.json @@ -0,0 +1,12 @@ +{ + "en": { + "flag": "Flag", + "flagged": "Flagged", + "flag-notif": "Thank you for reporting this comment. Our moderation team has been notified and will review it shortly." + }, + "es": { + "flag": "Marcar", + "flagged": "Marcado", + "flag-notif": "Gracias por marcar este comentario. Nuestro equipo de moderación ha sido notificado y muy pronto lo va a revisar." + } +} diff --git a/client/coral-plugin-replies/ReplyBox.js b/client/coral-plugin-replies/ReplyBox.js index d9fddf1ad..6614aed72 100644 --- a/client/coral-plugin-replies/ReplyBox.js +++ b/client/coral-plugin-replies/ReplyBox.js @@ -4,7 +4,7 @@ import CommentBox from '../coral-plugin-commentbox/CommentBox'; const name = 'coral-plugin-replies'; const ReplyBox = (props) =>
{ props.showReply &&