diff options
author | 2017-11-14 21:04:41 +0100 | |
---|---|---|
committer | 2017-11-14 21:04:41 +0100 | |
commit | dcab45a323f53a10ff5f419daa5ba6442817eebc (patch) | |
tree | b9212d00a8c3a088292180d72895dfeef3536ed1 /src/containers/settings/EditSettingsScreen.js | |
parent | [wip] share user settings with service (diff) | |
download | ferdium-app-dcab45a323f53a10ff5f419daa5ba6442817eebc.tar.gz ferdium-app-dcab45a323f53a10ff5f419daa5ba6442817eebc.tar.zst ferdium-app-dcab45a323f53a10ff5f419daa5ba6442817eebc.zip |
feat(App): Add option to enable/disable spell checker
Diffstat (limited to 'src/containers/settings/EditSettingsScreen.js')
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index e146dc97c..62e255dab 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -7,7 +7,7 @@ import AppStore from '../../stores/AppStore'; | |||
7 | import SettingsStore from '../../stores/SettingsStore'; | 7 | import SettingsStore from '../../stores/SettingsStore'; |
8 | import UserStore from '../../stores/UserStore'; | 8 | import UserStore from '../../stores/UserStore'; |
9 | import Form from '../../lib/Form'; | 9 | import Form from '../../lib/Form'; |
10 | import languages from '../../i18n/languages'; | 10 | import { APP_LOCALES } from '../../i18n/languages'; |
11 | import { gaPage } from '../../lib/analytics'; | 11 | import { gaPage } from '../../lib/analytics'; |
12 | import { DEFAULT_APP_SETTINGS } from '../../config'; | 12 | import { DEFAULT_APP_SETTINGS } from '../../config'; |
13 | 13 | ||
@@ -47,6 +47,14 @@ const messages = defineMessages({ | |||
47 | id: 'settings.app.form.enableSpellchecking', | 47 | id: 'settings.app.form.enableSpellchecking', |
48 | defaultMessage: '!!!Enable spell checking', | 48 | defaultMessage: '!!!Enable spell checking', |
49 | }, | 49 | }, |
50 | spellcheckingLanguage: { | ||
51 | id: 'settings.app.form.spellcheckingLanguage', | ||
52 | defaultMessage: '!!!Language for spell checking', | ||
53 | }, | ||
54 | // spellcheckingAutomaticDetection: { | ||
55 | // id: 'settings.app.form.spellcheckingAutomaticDetection', | ||
56 | // defaultMessage: '!!!Detect language automatically', | ||
57 | // }, | ||
50 | beta: { | 58 | beta: { |
51 | id: 'settings.app.form.beta', | 59 | id: 'settings.app.form.beta', |
52 | defaultMessage: '!!!Include beta versions', | 60 | defaultMessage: '!!!Include beta versions', |
@@ -78,6 +86,7 @@ export default class EditSettingsScreen extends Component { | |||
78 | minimizeToSystemTray: settingsData.minimizeToSystemTray, | 86 | minimizeToSystemTray: settingsData.minimizeToSystemTray, |
79 | showDisabledServices: settingsData.showDisabledServices, | 87 | showDisabledServices: settingsData.showDisabledServices, |
80 | enableSpellchecking: settingsData.enableSpellchecking, | 88 | enableSpellchecking: settingsData.enableSpellchecking, |
89 | // spellcheckingLanguage: settingsData.spellcheckingLanguage, | ||
81 | locale: settingsData.locale, | 90 | locale: settingsData.locale, |
82 | beta: settingsData.beta, | 91 | beta: settingsData.beta, |
83 | }, | 92 | }, |
@@ -94,14 +103,25 @@ export default class EditSettingsScreen extends Component { | |||
94 | const { app, settings, user } = this.props.stores; | 103 | const { app, settings, user } = this.props.stores; |
95 | const { intl } = this.context; | 104 | const { intl } = this.context; |
96 | 105 | ||
97 | const options = []; | 106 | const locales = []; |
98 | Object.keys(languages).forEach((key) => { | 107 | Object.keys(APP_LOCALES).forEach((key) => { |
99 | options.push({ | 108 | locales.push({ |
100 | value: key, | 109 | value: key, |
101 | label: languages[key], | 110 | label: APP_LOCALES[key], |
102 | }); | 111 | }); |
103 | }); | 112 | }); |
104 | 113 | ||
114 | // const spellcheckerLocales = [{ | ||
115 | // value: 'auto', | ||
116 | // label: intl.formatMessage(messages.spellcheckingAutomaticDetection), | ||
117 | // }]; | ||
118 | // Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { | ||
119 | // spellcheckerLocales.push({ | ||
120 | // value: key, | ||
121 | // label: SPELLCHECKER_LOCALES[key], | ||
122 | // }); | ||
123 | // }); | ||
124 | |||
105 | const config = { | 125 | const config = { |
106 | fields: { | 126 | fields: { |
107 | autoLaunchOnStart: { | 127 | autoLaunchOnStart: { |
@@ -139,10 +159,16 @@ export default class EditSettingsScreen extends Component { | |||
139 | value: settings.all.enableSpellchecking, | 159 | value: settings.all.enableSpellchecking, |
140 | default: DEFAULT_APP_SETTINGS.enableSpellchecking, | 160 | default: DEFAULT_APP_SETTINGS.enableSpellchecking, |
141 | }, | 161 | }, |
162 | // spellcheckingLanguage: { | ||
163 | // label: intl.formatMessage(messages.spellcheckingLanguage), | ||
164 | // value: settings.all.spellcheckingLanguage, | ||
165 | // options: spellcheckerLocales, | ||
166 | // default: DEFAULT_APP_SETTINGS.spellcheckingLanguage, | ||
167 | // }, | ||
142 | locale: { | 168 | locale: { |
143 | label: intl.formatMessage(messages.language), | 169 | label: intl.formatMessage(messages.language), |
144 | value: app.locale, | 170 | value: app.locale, |
145 | options, | 171 | options: locales, |
146 | default: DEFAULT_APP_SETTINGS.locale, | 172 | default: DEFAULT_APP_SETTINGS.locale, |
147 | }, | 173 | }, |
148 | beta: { | 174 | beta: { |