save setting, fix warning
This commit is contained in:
parent
48b02567a0
commit
68e0eb66d2
2 changed files with 4 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
||||||
import * as types from "constants/action_types";
|
import * as types from "constants/action_types";
|
||||||
|
import * as settings from "constants/settings";
|
||||||
import batchActions from "util/batchActions";
|
import batchActions from "util/batchActions";
|
||||||
import lbry from "lbry";
|
import lbry from "lbry";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
@ -133,6 +134,7 @@ export function doDownloadLanguages() {
|
||||||
|
|
||||||
export function doChangeLanguage(language) {
|
export function doChangeLanguage(language) {
|
||||||
return function(dispatch, getState) {
|
return function(dispatch, getState) {
|
||||||
|
lbry.setClientSetting(settings.LANGUAGE, language);
|
||||||
app.i18n.setLocale(language);
|
app.i18n.setLocale(language);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,15 +125,12 @@ class SettingsPage extends React.PureComponent {
|
||||||
<FormField
|
<FormField
|
||||||
type="select"
|
type="select"
|
||||||
name="language"
|
name="language"
|
||||||
|
defaultValue={language}
|
||||||
onChange={this.onLanguageChange.bind(this)}
|
onChange={this.onLanguageChange.bind(this)}
|
||||||
>
|
>
|
||||||
<option value="en">{__("English")}</option>
|
<option value="en">{__("English")}</option>
|
||||||
{Object.keys(languages).map(dLang =>
|
{Object.keys(languages).map(dLang =>
|
||||||
<option
|
<option key={dLang} value={dLang}>
|
||||||
key={dLang}
|
|
||||||
selected={dLang == language ? "selected" : null}
|
|
||||||
value={dLang}
|
|
||||||
>
|
|
||||||
{languages[dLang]}
|
{languages[dLang]}
|
||||||
</option>
|
</option>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Add table
Reference in a new issue