diff options
author | 2018-11-30 14:32:45 +0100 | |
---|---|---|
committer | 2018-11-30 14:32:45 +0100 | |
commit | 3d87c0e45cead95ddb6c11fc6540b82e375bdcf5 (patch) | |
tree | c91f425a39cb585242d6df5b4070de4a2141b3b4 /src/containers | |
parent | Merge branch 'update/monetization' into develop (diff) | |
download | ferdium-app-3d87c0e45cead95ddb6c11fc6540b82e375bdcf5.tar.gz ferdium-app-3d87c0e45cead95ddb6c11fc6540b82e375bdcf5.tar.zst ferdium-app-3d87c0e45cead95ddb6c11fc6540b82e375bdcf5.zip |
feat(App): Improved spell checker & context menu
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 7da009c8b..ea1d319d9 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 { APP_LOCALES } from '../../i18n/languages'; | 10 | import { APP_LOCALES, SPELLCHECKER_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 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | 13 | import { config as spellcheckerConfig } from '../../features/spellchecker'; |
@@ -60,8 +60,8 @@ const messages = defineMessages({ | |||
60 | id: 'settings.app.form.enableGPUAcceleration', | 60 | id: 'settings.app.form.enableGPUAcceleration', |
61 | defaultMessage: '!!!Enable GPU Acceleration', | 61 | defaultMessage: '!!!Enable GPU Acceleration', |
62 | }, | 62 | }, |
63 | spellcheckingLanguage: { | 63 | spellcheckerLanguage: { |
64 | id: 'settings.app.form.spellcheckingLanguage', | 64 | id: 'settings.app.form.spellcheckerLanguage', |
65 | defaultMessage: '!!!Language for spell checking', | 65 | defaultMessage: '!!!Language for spell checking', |
66 | }, | 66 | }, |
67 | beta: { | 67 | beta: { |
@@ -98,6 +98,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
98 | darkMode: settingsData.darkMode, | 98 | darkMode: settingsData.darkMode, |
99 | showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, | 99 | showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, |
100 | enableSpellchecking: settingsData.enableSpellchecking, | 100 | enableSpellchecking: settingsData.enableSpellchecking, |
101 | spellcheckerLanguage: settingsData.spellcheckerLanguage, | ||
101 | beta: settingsData.beta, // we need this info in the main process as well | 102 | beta: settingsData.beta, // we need this info in the main process as well |
102 | locale: settingsData.locale, // we need this info in the main process as well | 103 | locale: settingsData.locale, // we need this info in the main process as well |
103 | }, | 104 | }, |
@@ -123,6 +124,14 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
123 | }); | 124 | }); |
124 | }); | 125 | }); |
125 | 126 | ||
127 | const spellcheckingLanguages = []; | ||
128 | Object.keys(SPELLCHECKER_LOCALES).sort(Intl.Collator().compare).forEach((key) => { | ||
129 | spellcheckingLanguages.push({ | ||
130 | value: key, | ||
131 | label: SPELLCHECKER_LOCALES[key], | ||
132 | }); | ||
133 | }); | ||
134 | |||
126 | const config = { | 135 | const config = { |
127 | fields: { | 136 | fields: { |
128 | autoLaunchOnStart: { | 137 | autoLaunchOnStart: { |
@@ -165,6 +174,12 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
165 | value: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : settings.all.app.enableSpellchecking, | 174 | value: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : settings.all.app.enableSpellchecking, |
166 | default: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : DEFAULT_APP_SETTINGS.enableSpellchecking, | 175 | default: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : DEFAULT_APP_SETTINGS.enableSpellchecking, |
167 | }, | 176 | }, |
177 | spellcheckerLanguage: { | ||
178 | label: intl.formatMessage(messages.spellcheckerLanguage), | ||
179 | value: settings.all.app.spellcheckerLanguage, | ||
180 | options: spellcheckingLanguages, | ||
181 | default: DEFAULT_APP_SETTINGS.spellcheckerLanguage, | ||
182 | }, | ||
168 | darkMode: { | 183 | darkMode: { |
169 | label: intl.formatMessage(messages.darkMode), | 184 | label: intl.formatMessage(messages.darkMode), |
170 | value: settings.all.app.darkMode, | 185 | value: settings.all.app.darkMode, |