From 12896bd23eeba79884245c1c29fdc568cf21a7fa Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Mon, 14 Mar 2016 08:50:46 -0400
Subject: Converting to Webpack. Stage 1.

---
 .../components/user_settings/manage_languages.jsx  | 118 ---------------------
 1 file changed, 118 deletions(-)
 delete mode 100644 web/react/components/user_settings/manage_languages.jsx

(limited to 'web/react/components/user_settings/manage_languages.jsx')

diff --git a/web/react/components/user_settings/manage_languages.jsx b/web/react/components/user_settings/manage_languages.jsx
deleted file mode 100644
index 6b00a65c7..000000000
--- a/web/react/components/user_settings/manage_languages.jsx
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import SettingItemMax from '../setting_item_max.jsx';
-
-import * as Client from '../../utils/client.jsx';
-import * as Utils from '../../utils/utils.jsx';
-import * as GlobalActions from '../../action_creators/global_actions.jsx';
-
-import {FormattedMessage} from 'mm-intl';
-
-export default class ManageLanguage extends React.Component {
-    constructor(props) {
-        super(props);
-
-        this.setupInitialState = this.setupInitialState.bind(this);
-        this.setLanguage = this.setLanguage.bind(this);
-        this.changeLanguage = this.changeLanguage.bind(this);
-        this.submitUser = this.submitUser.bind(this);
-        this.state = this.setupInitialState(props);
-    }
-    setupInitialState(props) {
-        var user = props.user;
-        return {
-            languages: Utils.languages(),
-            locale: user.locale
-        };
-    }
-    setLanguage(e) {
-        this.setState({locale: e.target.value});
-    }
-    changeLanguage(e) {
-        e.preventDefault();
-
-        var user = this.props.user;
-        var locale = this.state.locale;
-
-        user.locale = locale;
-
-        this.submitUser(user);
-    }
-    submitUser(user) {
-        Client.updateUser(user,
-            () => {
-                GlobalActions.newLocalizationSelected(user.locale);
-            },
-            (err) => {
-                let serverError;
-                if (err.message) {
-                    serverError = err.message;
-                } else {
-                    serverError = err;
-                }
-                this.setState({serverError});
-            }
-        );
-    }
-    render() {
-        let serverError;
-        if (this.state.serverError) {
-            serverError = <label className='has-error'>{this.state.serverError}</label>;
-        }
-
-        const options = [];
-        this.state.languages.forEach((lang) => {
-            options.push(
-                <option
-                    key={lang.value}
-                    value={lang.value}
-                >
-                    {lang.name}
-                </option>);
-        });
-
-        const input = (
-            <div key='changeLanguage'>
-                <br/>
-                <label className='control-label'>
-                    <FormattedMessage
-                        id='user.settings.languages.change'
-                        defaultMessage='Change interface language'
-                    />
-                </label>
-                <div className='padding-top'>
-                    <select
-                        ref='language'
-                        className='form-control'
-                        value={this.state.locale}
-                        onChange={this.setLanguage}
-                    >
-                        {options}
-                    </select>
-                    {serverError}
-                </div>
-            </div>
-        );
-
-        return (
-            <SettingItemMax
-                title={
-                    <FormattedMessage
-                        id='user.settings.display.language'
-                        defaultMessage='Language'
-                    />
-                }
-                width='medium'
-                submit={this.changeLanguage}
-                inputs={[input]}
-                updateSection={this.props.updateSection}
-            />
-        );
-    }
-}
-
-ManageLanguage.propTypes = {
-    user: React.PropTypes.object.isRequired,
-    updateSection: React.PropTypes.func.isRequired
-};
-- 
cgit v1.2.3-1-g7c22

