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/navbar_dropdown.jsx | 68 ++++++++++++++++++++++++++------
 1 file changed, 56 insertions(+), 12 deletions(-)

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

diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx
index d4ec5a5f5..e9df03c33 100644
--- a/web/react/components/navbar_dropdown.jsx
+++ b/web/react/components/navbar_dropdown.jsx
@@ -14,6 +14,8 @@ import UserSettingsModal from './user_settings/user_settings_modal.jsx';
 
 import Constants from '../utils/constants.jsx';
 
+import {FormattedMessage} from 'mm-intl';
+
 function getStateFromStores() {
     const teams = [];
     const teamsObject = UserStore.getTeams();
@@ -97,7 +99,10 @@ export default class NavbarDropdown extends React.Component {
                         href='#'
                         onClick={EventHelpers.showInviteMemberModal}
                     >
-                        {'Invite New Member'}
+                        <FormattedMessage
+                            id='navbar_dropdown.inviteMember'
+                            defaultMessage='Invite New Member'
+                        />
                     </a>
                 </li>
             );
@@ -109,7 +114,10 @@ export default class NavbarDropdown extends React.Component {
                             href='#'
                             onClick={EventHelpers.showGetTeamInviteLinkModal}
                         >
-                            {'Get Team Invite Link'}
+                            <FormattedMessage
+                                id='navbar_dropdown.teamLink'
+                                defaultMessage='Get Team Invite Link'
+                            />
                         </a>
                     </li>
                 );
@@ -120,7 +128,10 @@ export default class NavbarDropdown extends React.Component {
             manageLink = (
                 <li>
                     <ToggleModalButton dialogType={TeamMembersModal}>
-                        {'Manage Members'}
+                        <FormattedMessage
+                            id='navbar_dropdown.manageMembers'
+                            defaultMessage='Manage Members'
+                        />
                     </ToggleModalButton>
                 </li>
             );
@@ -134,7 +145,10 @@ export default class NavbarDropdown extends React.Component {
                         data-toggle='modal'
                         data-target='#team_settings'
                     >
-                        {'Team Settings'}
+                        <FormattedMessage
+                            id='navbar_dropdown.teamSettings'
+                            defaultMessage='Team Settings'
+                        />
                     </a>
                 </li>
             );
@@ -146,7 +160,10 @@ export default class NavbarDropdown extends React.Component {
                     <a
                         href={'/admin_console?' + Utils.getSessionIndex()}
                     >
-                        {'System Console'}
+                        <FormattedMessage
+                            id='navbar_dropdown.console'
+                            defaultMessage='System Console'
+                        />
                     </a>
                 </li>
             );
@@ -165,7 +182,16 @@ export default class NavbarDropdown extends React.Component {
 
             this.state.teams.forEach((team) => {
                 if (team.name !== this.props.teamName) {
-                    teams.push(<li key={team.name}><a href={Utils.getWindowLocationOrigin() + '/' + team.name}>{'Switch to ' + team.display_name}</a></li>);
+                    teams.push(
+                        <li key={team.name}><a href={Utils.getWindowLocationOrigin() + '/' + team.name}>
+                            <FormattedMessage
+                                id='navbar_dropdown.switchTeam'
+                                defaultMessage='Switch to {team}'
+                                values={{
+                                    team: team.display_name
+                                }}
+                            />
+                        </a></li>);
                 }
             });
         }
@@ -178,7 +204,10 @@ export default class NavbarDropdown extends React.Component {
                         target='_blank'
                         href={Utils.getWindowLocationOrigin() + '/signup_team'}
                     >
-                        {'Create a New Team'}
+                        <FormattedMessage
+                            id='navbar_dropdown.create'
+                            defaultMessage='Create a New Team'
+                        />
                     </a>
                 </li>
             );
@@ -192,7 +221,10 @@ export default class NavbarDropdown extends React.Component {
                         target='_blank'
                         href={global.window.mm_config.HelpLink}
                     >
-                        {'Help'}
+                        <FormattedMessage
+                            id='navbar_dropdown.help'
+                            defaultMessage='Help'
+                        />
                     </a>
                 </li>
             );
@@ -206,7 +238,10 @@ export default class NavbarDropdown extends React.Component {
                         target='_blank'
                         href={global.window.mm_config.ReportAProblemLink}
                     >
-                        {'Report a Problem'}
+                        <FormattedMessage
+                            id='navbar_dropdown.report'
+                            defaultMessage='Report a Problem'
+                        />
                     </a>
                 </li>
             );
@@ -239,7 +274,10 @@ export default class NavbarDropdown extends React.Component {
                                 href='#'
                                 onClick={() => this.setState({showUserSettingsModal: true})}
                             >
-                                {'Account Settings'}
+                                <FormattedMessage
+                                    id='navbar_dropdown.accountSettings'
+                                    defaultMessage='Account Settings'
+                                />
                             </a>
                         </li>
                         {inviteLink}
@@ -249,7 +287,10 @@ export default class NavbarDropdown extends React.Component {
                                 href='#'
                                 onClick={this.handleLogoutClick}
                             >
-                                {'Logout'}
+                                <FormattedMessage
+                                    id='navbar_dropdown.logout'
+                                    defaultMessage='Logout'
+                                />
                             </a>
                         </li>
                         {adminDivider}
@@ -265,7 +306,10 @@ export default class NavbarDropdown extends React.Component {
                                 href='#'
                                 onClick={this.handleAboutModal}
                             >
-                                {'About Mattermost'}
+                                <FormattedMessage
+                                    id='navbar_dropdown.about'
+                                    defaultMessage='About Mattermost'
+                                />
                             </a>
                         </li>
                         <UserSettingsModal
-- 
cgit v1.2.3-1-g7c22

