From cdfa9b585a220353114924477a300fb6d3e50df8 Mon Sep 17 00:00:00 2001
From: Elias Nahum <nahumhbl@gmail.com>
Date: Wed, 3 Feb 2016 12:16:28 -0300
Subject: Messages for SocketStore and small fixes

---
 web/react/components/channel_loader.jsx | 52 ++++++++++++++++++++++++++++++++-
 1 file changed, 51 insertions(+), 1 deletion(-)

(limited to 'web/react/components/channel_loader.jsx')

diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx
index 712d6885f..15571ad93 100644
--- a/web/react/components/channel_loader.jsx
+++ b/web/react/components/channel_loader.jsx
@@ -15,7 +15,40 @@ import PreferenceStore from '../stores/preference_store.jsx';
 import * as Utils from '../utils/utils.jsx';
 import Constants from '../utils/constants.jsx';
 
-export default class ChannelLoader extends React.Component {
+import {intlShape, injectIntl, defineMessages} from 'mm-intl';
+
+const holders = defineMessages({
+    socketError: {
+        id: 'channel_loader.socketError',
+        defaultMessage: 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.'
+    },
+    someone: {
+        id: 'channel_loader.someone',
+        defaultMessage: 'Someone'
+    },
+    posted: {
+        id: 'channel_loader.posted',
+        defaultMessage: 'Posted'
+    },
+    uploadedImage: {
+        id: 'channel_loader.uploadedImage',
+        defaultMessage: ' uploaded an image'
+    },
+    uploadedFile: {
+        id: 'channel_loader.uploadedFile',
+        defaultMessage: ' uploaded a file'
+    },
+    something: {
+        id: 'channel_loader.something',
+        defaultMessage: ' did something new'
+    },
+    wrote: {
+        id: 'channel_loader.wrote',
+        defaultMessage: ' wrote: '
+    }
+});
+
+class ChannelLoader extends React.Component {
     constructor(props) {
         super(props);
 
@@ -23,6 +56,17 @@ export default class ChannelLoader extends React.Component {
 
         this.onSocketChange = this.onSocketChange.bind(this);
 
+        const {formatMessage} = this.props.intl;
+        SocketStore.setTranslations({
+            socketError: formatMessage(holders.socketError),
+            someone: formatMessage(holders.someone),
+            posted: formatMessage(holders.posted),
+            uploadedImage: formatMessage(holders.uploadedImage),
+            uploadedFile: formatMessage(holders.uploadedFile),
+            something: formatMessage(holders.something),
+            wrote: formatMessage(holders.wrote)
+        });
+
         this.state = {};
     }
     componentDidMount() {
@@ -126,3 +170,9 @@ export default class ChannelLoader extends React.Component {
         return <div/>;
     }
 }
+
+ChannelLoader.propTypes = {
+    intl: intlShape.isRequired
+};
+
+export default injectIntl(ChannelLoader);
\ No newline at end of file
-- 
cgit v1.2.3-1-g7c22

