diff options
author | =Corey Hulen <corey@hulen.com> | 2016-01-22 09:10:08 -0600 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-01-22 09:10:08 -0600 |
commit | da1d52d546121e6c36cca9dea90c4a3bc540b0b7 (patch) | |
tree | e7397daca2d6a9a2143919b79074c2c4e0708fe1 /web/react/components/user_settings/user_settings_display.jsx | |
parent | 5d14ab71745f85f3aa039df5b84c9f0b63846a2b (diff) | |
download | chat-da1d52d546121e6c36cca9dea90c4a3bc540b0b7.tar.gz chat-da1d52d546121e6c36cca9dea90c4a3bc540b0b7.tar.bz2 chat-da1d52d546121e6c36cca9dea90c4a3bc540b0b7.zip |
PLT-7 adding lang selector
Diffstat (limited to 'web/react/components/user_settings/user_settings_display.jsx')
-rw-r--r-- | web/react/components/user_settings/user_settings_display.jsx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/web/react/components/user_settings/user_settings_display.jsx b/web/react/components/user_settings/user_settings_display.jsx index 1ff0a2913..b12eb2d9c 100644 --- a/web/react/components/user_settings/user_settings_display.jsx +++ b/web/react/components/user_settings/user_settings_display.jsx @@ -6,6 +6,7 @@ import SettingItemMin from '../setting_item_min.jsx'; import SettingItemMax from '../setting_item_max.jsx'; import Constants from '../../utils/constants.jsx'; import PreferenceStore from '../../stores/preference_store.jsx'; +import ManageLanguages from './manage_languages.jsx'; import * as Utils from '../../utils/utils.jsx'; function getDisplayStateFromStores() { @@ -78,6 +79,7 @@ export default class UserSettingsDisplay extends React.Component { let clockSection; let nameFormatSection; let fontSection; + let languagesSection; if (this.props.activeSection === 'clock') { const clockFormat = [false, false]; @@ -292,6 +294,46 @@ export default class UserSettingsDisplay extends React.Component { ); } + if (this.props.activeSection === 'languages') { + var inputs = []; + inputs.push( + <ManageLanguages + user={this.props.user} + key='languages-ui' + /> + ); + + languagesSection = ( + <SettingItemMax + title={'Language'} + width='medium' + inputs={inputs} + updateSection={(e) => { + this.updateSection(''); + e.preventDefault(); + }} + /> + ); + } else { + var locale = 'English'; + Utils.languages().forEach((l) => { + if (l.value === this.props.user.locale) { + locale = l.name; + } + }); + + languagesSection = ( + <SettingItemMin + title={'Language'} + width='medium' + describe={locale} + updateSection={() => { + this.updateSection('languages'); + }} + /> + ); + } + return ( <div> <div className='modal-header'> @@ -324,6 +366,8 @@ export default class UserSettingsDisplay extends React.Component { <div className='divider-dark'/> {nameFormatSection} <div className='divider-dark'/> + {languagesSection} + <div className='divider-dark'/> </div> </div> ); |