Commit 9b1a83bd authored by roadscape's avatar roadscape
Browse files

re-add Language switch in settings

parent ff55c1ae
......@@ -188,6 +188,12 @@ class Settings extends React.Component {
});
};
handleLanguageChange = event => {
const locale = event.target.value;
const userPreferences = { ...this.props.user_preferences, locale };
this.props.setUserPreferences(userPreferences);
};
render() {
const { state, props } = this;
......@@ -350,6 +356,32 @@ class Settings extends React.Component {
) : null}
</form>
</div>
<br />
<br />
<h4>{tt('settings_jsx.preferences')}</h4>
<div className="row">
<div className="small-12 medium-6 large-12 columns">
<label>
{tt('g.choose_language')}
<select
defaultValue={user_preferences.locale}
onChange={this.handleLanguageChange}
>
<option value="en">English</option>
<option value="es">Spanish Español</option>
<option value="ru">Russian русский</option>
<option value="fr">French français</option>
<option value="it">Italian italiano</option>
<option value="ko">Korean 한국어</option>
<option value="ja">Japanese 日本語</option>
<option value="pl">Polish</option>
<option value="zh">Chinese 简体中文</option>
</select>
</label>
</div>
</div>
</div>
);
}
......@@ -385,6 +417,9 @@ export default connect(
changeLanguage: language => {
dispatch(userActions.changeLanguage(language));
},
setUserPreferences: payload => {
dispatch(appActions.setUserPreferences(payload));
},
uploadImage: (file, progress) =>
dispatch(userActions.uploadImage({ file, progress })),
updateAccount: ({ successCallback, errorCallback, ...operation }) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment