From d424c9eaf12653332f15afa2cb9dfc6684fa95d8 Mon Sep 17 00:00:00 2001
From: Elias Nahum <nahumhbl@gmail.com>
Date: Tue, 2 Feb 2016 19:39:56 -0300
Subject: PLT-7: Refactoring frontend (chunk 10) - Modals - Fix bug on
 msg_typing - Add missing translations in es.json for EE

---
 web/react/components/edit_post_modal.jsx | 40 ++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 5 deletions(-)

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

diff --git a/web/react/components/edit_post_modal.jsx b/web/react/components/edit_post_modal.jsx
index e4e77a943..e54b7d9b8 100644
--- a/web/react/components/edit_post_modal.jsx
+++ b/web/react/components/edit_post_modal.jsx
@@ -10,9 +10,19 @@ import PostStore from '../stores/post_store.jsx';
 import PreferenceStore from '../stores/preference_store.jsx';
 
 import Constants from '../utils/constants.jsx';
+
+import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl';
+
 var KeyCodes = Constants.KeyCodes;
 
-export default class EditPostModal extends React.Component {
+const holders = defineMessages({
+    editPost: {
+        id: 'edit_post.editPost',
+        defaultMessage: 'Edit the post...'
+    }
+});
+
+class EditPostModal extends React.Component {
     constructor() {
         super();
 
@@ -151,7 +161,15 @@ export default class EditPostModal extends React.Component {
                             >
                                 <span aria-hidden='true'>&times;</span>
                             </button>
-                        <h4 className='modal-title'>Edit {this.state.title}</h4>
+                        <h4 className='modal-title'>
+                            <FormattedMessage
+                                id='edit_post.edit'
+                                defaultMessage='Edit {title}'
+                                values={{
+                                    title: this.state.title
+                                }}
+                            />
+                        </h4>
                         </div>
                         <div className='edit-modal-body modal-body'>
                             <Textbox
@@ -159,7 +177,7 @@ export default class EditPostModal extends React.Component {
                                 onKeyPress={this.handleEditKeyPress}
                                 onKeyDown={this.handleKeyDown}
                                 messageText={this.state.editText}
-                                createMessage='Edit the post...'
+                                createMessage={this.props.intl.formatMessage(holders.editPost)}
                                 supportsCommands={false}
                                 id='edit_textbox'
                                 ref='editbox'
@@ -172,14 +190,20 @@ export default class EditPostModal extends React.Component {
                                 className='btn btn-default'
                                 data-dismiss='modal'
                             >
-                                Cancel
+                                <FormattedMessage
+                                    id='edit_post.cancel'
+                                    defaultMessage='Cancel'
+                                />
                             </button>
                             <button
                                 type='button'
                                 className='btn btn-primary'
                                 onClick={this.handleEdit}
                             >
-                                Save
+                                <FormattedMessage
+                                    id='edit_post.save'
+                                    defaultMessage='Save'
+                                />
                             </button>
                         </div>
                     </div>
@@ -188,3 +212,9 @@ export default class EditPostModal extends React.Component {
         );
     }
 }
+
+EditPostModal.propTypes = {
+    intl: intlShape.isRequired
+};
+
+export default injectIntl(EditPostModal);
\ No newline at end of file
-- 
cgit v1.2.3-1-g7c22

