Adding seperate translation files for packages.

This commit is contained in:
David Jay
2016-11-10 17:34:26 -05:00
parent 8bf6bea5b9
commit ff4e778dde
11 changed files with 57 additions and 63 deletions
@@ -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"
}
}
@@ -1,13 +0,0 @@
{
"modqueue": {
"pending": "pendiente",
"rejected": "rechazado",
"flagged": "marcado",
"shortcuts": "Atajos de teclado",
"close": "Cerrar"
},
"comment": {
"flagged": "marcado",
"anon": "Anónimo"
}
}
@@ -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 <div className={`${name }-text`}>
{`${count } ${ count === 1 ? 'Comment' : 'Comments'}`}
return <div className={`${name}-text`}>
{`${count} ${count === 1 ? lang.t('comment') : lang.t('comment-plural')}`}
</div>;
};
export default CommentCount;
const lang = new I18n(translations);
@@ -0,0 +1,10 @@
{
"en": {
"comment": "Comment",
"comment-plural": "Comments",
},
"es": {
"comment": "Comentario",
"comment-plural": "Comentarios"
}
}
+2 -12
View File
@@ -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';
@@ -88,15 +89,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);
@@ -0,0 +1,12 @@
{
"en": {
"post": "Post",
"reply": "Reply",
"comment": "Comment",
},
"es": {
"post": "Publicar",
"reply": "Respuesta",
"comment": "Comentario"
}
}
+6 -2
View File
@@ -1,4 +1,6 @@
import React from 'react';
import {I18n} from '../coral-framework';
import translations from './translations.json';
const name = 'coral-plugin-flags';
@@ -20,8 +22,8 @@ const FlagButton = ({flag, id, postAction, addItem, updateItem, addNotification}
aria-hidden={true}>flag</i>
{
flagged
? <span className={`${name }-button-text`}>Flagged</span>
: <span className={`${name }-button-text`}>Flag</span>
? <span className={`${name}-button-text`}>lang.t('flag')</span>
: <span className={`${name}-button-text`}>lang.t('flagged')</span>
}
</button>
</div>;
@@ -37,3 +39,5 @@ const styles = {
color: 'inherit'
}
};
const lang = new I18n(translations);
@@ -0,0 +1,10 @@
{
"en": {
"flag": "Flag",
"flagged": "Flagged"
},
"es": {
"flag": "¡traduceme!",
"flagged": "¡traduceme!"
}
}
+1 -1
View File
@@ -4,7 +4,7 @@ import CommentBox from '../coral-plugin-commentbox/CommentBox';
const name = 'coral-plugin-replies';
const ReplyBox = (props) => <div
className={`${name }-textarea`}
className={`${name}-textarea`}
style={props.styles && props.styles.container}>
{
props.showReply && <CommentBox
+2 -8
View File
@@ -1,5 +1,6 @@
import React from 'react';
import {I18n} from '../coral-framework';
import translations from './translations.json';
const name = 'coral-plugin-replies';
@@ -13,11 +14,4 @@ const ReplyButton = (props) => <button
export default ReplyButton;
const lang = new I18n({
en: {
'reply': 'Reply'
},
es: {
'reply': '¡traduceme!'
}
});
const lang = new I18n(translations);
@@ -0,0 +1,8 @@
{
"en": {
"reply": "Reply"
},
"es": {
"reply": "Respuesta"
}
}