summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_attachment.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-02-03 12:11:02 -0800
committer=Corey Hulen <corey@hulen.com>2016-02-03 12:11:02 -0800
commitd3a965a362037b4872dd9a8471e60f853bfc304e (patch)
tree8c767a534b600e426418f5a0cbae02820d7bfe5e /web/react/components/post_attachment.jsx
parentbdfa4715d65ed4b4e903a1eb4c83eba6c95455d1 (diff)
parent2b4af8d8c73ba5b9b683b65b1df4d4e3f24edb81 (diff)
downloadchat-d3a965a362037b4872dd9a8471e60f853bfc304e.tar.gz
chat-d3a965a362037b4872dd9a8471e60f853bfc304e.tar.bz2
chat-d3a965a362037b4872dd9a8471e60f853bfc304e.zip
Merge branch 'master' into PLT-1429
Diffstat (limited to 'web/react/components/post_attachment.jsx')
-rw-r--r--web/react/components/post_attachment.jsx22
1 files changed, 19 insertions, 3 deletions
diff --git a/web/react/components/post_attachment.jsx b/web/react/components/post_attachment.jsx
index 676bc91af..2eedfb7c1 100644
--- a/web/react/components/post_attachment.jsx
+++ b/web/react/components/post_attachment.jsx
@@ -3,7 +3,20 @@
import * as TextFormatting from '../utils/text_formatting.jsx';
-export default class PostAttachment extends React.Component {
+import {intlShape, injectIntl, defineMessages} from 'mm-intl';
+
+const holders = defineMessages({
+ collapse: {
+ id: 'post_attachment.collapse',
+ defaultMessage: '▲ collapse text'
+ },
+ more: {
+ id: 'post_attachment.more',
+ defaultMessage: '▼ read more'
+ }
+});
+
+class PostAttachment extends React.Component {
constructor(props) {
super(props);
@@ -28,7 +41,7 @@ export default class PostAttachment extends React.Component {
getInitState() {
const shouldCollapse = this.shouldCollapse();
const text = TextFormatting.formatText(this.props.attachment.text || '');
- const uncollapsedText = text + (shouldCollapse ? '<a class="attachment-link-more" href="#">▲ collapse text</a>' : '');
+ const uncollapsedText = text + (shouldCollapse ? `<a class="attachment-link-more" href="#">${this.props.intl.formatMessage(holders.collapse)}</a>` : '');
const collapsedText = shouldCollapse ? this.getCollapsedText() : text;
return {
@@ -62,7 +75,7 @@ export default class PostAttachment extends React.Component {
text = text.substr(0, 700);
}
- return TextFormatting.formatText(text) + '<a class="attachment-link-more" href="#">▼ read more</a>';
+ return TextFormatting.formatText(text) + `<a class="attachment-link-more" href="#">${this.props.intl.formatMessage(holders.more)}</a>`;
}
getFieldsTable() {
@@ -292,5 +305,8 @@ export default class PostAttachment extends React.Component {
}
PostAttachment.propTypes = {
+ intl: intlShape.isRequired,
attachment: React.PropTypes.object.isRequired
};
+
+export default injectIntl(PostAttachment);