save setting, fix warning

This commit is contained in:
Jeremy Kauffman 2017-08-24 13:33:41 -04:00
parent 48b02567a0
commit 68e0eb66d2
2 changed files with 4 additions and 5 deletions

View file

@ -1,4 +1,5 @@
import * as types from "constants/action_types";
import * as settings from "constants/settings";
import batchActions from "util/batchActions";
import lbry from "lbry";
import fs from "fs";
@ -133,6 +134,7 @@ export function doDownloadLanguages() {
export function doChangeLanguage(language) {
return function(dispatch, getState) {
lbry.setClientSetting(settings.LANGUAGE, language);
app.i18n.setLocale(language);
};
}

View file

@ -125,15 +125,12 @@ class SettingsPage extends React.PureComponent {
<FormField
type="select"
name="language"
defaultValue={language}
onChange={this.onLanguageChange.bind(this)}
>
<option value="en">{__("English")}</option>
{Object.keys(languages).map(dLang =>
<option
key={dLang}
selected={dLang == language ? "selected" : null}
value={dLang}
>
<option key={dLang} value={dLang}>
{languages[dLang]}
</option>
)}