From 786e4dce7d520f79b8cf76939d84678d72941420 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 1 Jun 2016 11:56:27 -0400 Subject: Revert "PLT-1800 Load server side locale from the config.json" (#3201) --- .../admin_console/localization_settings.jsx | 145 --------------------- 1 file changed, 145 deletions(-) delete mode 100644 webapp/components/admin_console/localization_settings.jsx (limited to 'webapp/components/admin_console/localization_settings.jsx') diff --git a/webapp/components/admin_console/localization_settings.jsx b/webapp/components/admin_console/localization_settings.jsx deleted file mode 100644 index 6876e0c36..000000000 --- a/webapp/components/admin_console/localization_settings.jsx +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import React from 'react'; - -import * as I18n from 'i18n/i18n.jsx'; - -import AdminSettings from './admin_settings.jsx'; -import {FormattedMessage} from 'react-intl'; -import SettingsGroup from './settings_group.jsx'; -import DropdownSetting from './dropdown_setting.jsx'; -import MultiSelectSetting from './multiselect_settings.jsx'; - -export default class LocalizationSettings extends AdminSettings { - constructor(props) { - super(props); - - this.getConfigFromState = this.getConfigFromState.bind(this); - - this.renderSettings = this.renderSettings.bind(this); - this.canSave = this.canSave.bind(this); - - const locales = I18n.getAllLanguages(); - - this.state = Object.assign(this.state, { - hasErrors: false, - defaultServerLocale: props.config.LocalizationSettings.DefaultServerLocale, - defaultClientLocale: props.config.LocalizationSettings.DefaultClientLocale, - availableLocales: props.config.LocalizationSettings.AvailableLocales.split(','), - languages: Object.keys(locales).map((l) => { - return {value: locales[l].value, text: locales[l].name}; - }) - }); - } - - canSave() { - return this.state.availableLocales.join(',').indexOf(this.state.defaultClientLocale) !== -1; - } - - getConfigFromState(config) { - config.LocalizationSettings.DefaultServerLocale = this.state.defaultServerLocale; - config.LocalizationSettings.DefaultClientLocale = this.state.defaultClientLocale; - config.LocalizationSettings.AvailableLocales = this.state.availableLocales.join(','); - - return config; - } - - renderTitle() { - return ( -

- -

- ); - } - - renderSettings() { - return ( - - } - > - - } - value={this.state.defaultServerLocale} - onChange={this.handleChange} - helpText={ - - } - /> - - } - value={this.state.defaultClientLocale} - onChange={this.handleChange} - helpText={ - - } - /> - - } - selected={this.state.availableLocales} - mustBePresent={this.state.defaultClientLocale} - onChange={this.handleChange} - helpText={ - - } - noResultText={ - - } - errorText={ - - } - notPresent={ - - } - /> - - ); - } -} \ No newline at end of file -- cgit v1.2.3-1-g7c22