From a6102e27d48d00fcc733c4d16754961903a239e0 Mon Sep 17 00:00:00 2001
From: Elias Nahum <nahumhbl@gmail.com>
Date: Sun, 31 Jan 2016 22:03:30 -0300
Subject: PLT-7: Refactoring frontend (chunk 8) - Sidebar and related
 components - Small Tweak to demotion and add msg for terminal cmd

---
 web/react/components/change_url_modal.jsx | 54 +++++++++++++++++++++++++++----
 1 file changed, 48 insertions(+), 6 deletions(-)

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

diff --git a/web/react/components/change_url_modal.jsx b/web/react/components/change_url_modal.jsx
index bbe93f58d..49d1b86b4 100644
--- a/web/react/components/change_url_modal.jsx
+++ b/web/react/components/change_url_modal.jsx
@@ -4,6 +4,8 @@
 var Modal = ReactBootstrap.Modal;
 import * as Utils from '../utils/utils.jsx';
 
+import {FormattedMessage} from 'mm-intl';
+
 export default class ChangeUrlModal extends React.Component {
     constructor(props) {
         super(props);
@@ -39,21 +41,58 @@ export default class ChangeUrlModal extends React.Component {
     getURLError(url) {
         let error = []; //eslint-disable-line prefer-const
         if (url.length < 2) {
-            error.push(<span key='error1'>{'Must be longer than two characters'}<br/></span>);
+            error.push(
+                <span key='error1'>
+                    <FormattedMessage
+                        id='change_url.longer'
+                        defaultMessage='Must be longer than two characters'
+                    />
+                    <br/>
+                </span>
+            );
         }
         if (url.charAt(0) === '-' || url.charAt(0) === '_') {
-            error.push(<span key='error2'>{'Must start with a letter or number'}<br/></span>);
+            error.push(
+                <span key='error2'>
+                    <FormattedMessage
+                        id='change_url.startWithLetter'
+                        defaultMessage='Must start with a letter or number'
+                    />
+                    <br/>
+                </span>
+            );
         }
         if (url.length > 1 && (url.charAt(url.length - 1) === '-' || url.charAt(url.length - 1) === '_')) {
-            error.push(<span key='error3'>{'Must end with a letter or number'}<br/></span>);
+            error.push(
+                <span key='error3'>
+                    <FormattedMessage
+                        id='change_url.endWithLetter'
+                        defaultMessage='Must end with a letter or number'
+                    />
+                    <br/>
+                </span>);
         }
         if (url.indexOf('__') > -1) {
-            error.push(<span key='error4'>{'Can not contain two underscores in a row.'}<br/></span>);
+            error.push(
+                <span key='error4'>
+                    <FormattedMessage
+                        id='change_url.noUnderscore'
+                        defaultMessage='Can not contain two underscores in a row.'
+                    />
+                    <br/>
+                </span>);
         }
 
         // In case of error we don't detect
         if (error.length === 0) {
-            error.push(<span key='errorlast'>{'Invalid URL'}<br/></span>);
+            error.push(
+                <span key='errorlast'>
+                    <FormattedMessage
+                        id='change_url.invalidUrl'
+                        defaultMessage='Invalid URL'
+                    />
+                    <br/>
+                </span>);
         }
         return error;
     }
@@ -137,7 +176,10 @@ export default class ChangeUrlModal extends React.Component {
                             className='btn btn-default'
                             onClick={this.doCancel}
                         >
-                            {'Close'}
+                            <FormattedMessage
+                                id='change_url.close'
+                                defaultMessage='Close'
+                            />
                         </button>
                         <button
                             onClick={this.doSubmit}
-- 
cgit v1.2.3-1-g7c22

