client/src/components/SessionForm.js
changeset 192 e4c2c1919c20
parent 191 3f71ad81a5a9
--- a/client/src/components/SessionForm.js	Tue Dec 04 18:17:56 2018 +0100
+++ b/client/src/components/SessionForm.js	Tue Dec 04 18:56:31 2018 +0100
@@ -4,6 +4,8 @@
 import * as sessionsActions from '../actions/sessionsActions';
 import * as authActions from '../actions/authActions';
 import _ from 'lodash';
+import { withNamespaces } from 'react-i18next';
+
 
 class SessionForm extends Component {
 
@@ -113,13 +115,15 @@
 
   titleEditMode = () => {
 
+    const t = this.props.t;
+
     if (this.state.titleEditMode === false) {
       return (
       <div
         onClick={this.toggleOnTitleEditMode}
         className='session-page-title border-0 bg-irinotes-headers text-muted ml-3'
       >
-        { this.props.currentSession.title || <span className='session-placeholder'>Espace titre</span> }
+        { this.props.currentSession.title || <span className='session-placeholder'>{ t('session_form.empty_title_placeholder') }</span> }
       </div>
     );
     }
@@ -133,7 +137,7 @@
         type="textarea"
         name="title"
         defaultValue={ this.props.currentSession.title }
-        placeholder="Espace titre"
+        placeholder={ t('session_form.empty_title_placeholder') }
         ref={title => this.title = title}
       ></textarea>
     </div>
@@ -143,13 +147,15 @@
 
   descriptionEditMode = () => {
 
+  const t = this.props.t;
+
   if (this.state.descriptionEditMode === false) {
     return (
     <div
       onClick={this.toggleOnDescriptionEditMode}
       className="session-page-description border-0 bg-irinotes-headers text-muted ml-3"
     >
-      { this.props.currentSession.description || <span className='session-placeholder'>Espace description</span> }
+      { this.props.currentSession.description || <span className='session-placeholder'>{ t('session_form.empty_description_placeholder') }</span> }
     </div>
   );
   }
@@ -163,7 +169,7 @@
         type="textarea"
         name="description"
         defaultValue={ this.props.currentSession.description }
-        placeholder="Espace description"
+        placeholder={ t('session_form.empty_description_placeholder') }
         ref={desc => this.desc = desc}
       ></textarea>
     </div>
@@ -214,4 +220,4 @@
   }
 }
 
-export default connect(mapStateToProps, mapDispatchToProps)(SessionForm);
+export default withNamespaces()(connect(mapStateToProps, mapDispatchToProps)(SessionForm));