diff options
author | 2021-08-09 23:42:01 +0530 | |
---|---|---|
committer | 2021-08-09 23:42:01 +0530 | |
commit | 39f6c7a4c96e9704671769750823dea4a40093a2 (patch) | |
tree | b515fc605e7de994cda69e7a94f43315e24c6cd8 | |
parent | chore: i18n translations (diff) | |
download | ferdium-app-39f6c7a4c96e9704671769750823dea4a40093a2.tar.gz ferdium-app-39f6c7a4c96e9704671769750823dea4a40093a2.tar.zst ferdium-app-39f6c7a4c96e9704671769750823dea4a40093a2.zip |
chore: set default fallback locale for spell-checker to be 'en-US'.
-rw-r--r-- | src/internal-server/app/Controllers/Http/UserController.js | 5 | ||||
-rw-r--r-- | src/webview/spellchecker.js | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/internal-server/app/Controllers/Http/UserController.js b/src/internal-server/app/Controllers/Http/UserController.js index f7cdfc9c9..88c0deade 100644 --- a/src/internal-server/app/Controllers/Http/UserController.js +++ b/src/internal-server/app/Controllers/Http/UserController.js | |||
@@ -9,6 +9,7 @@ const btoa = require('btoa'); | |||
9 | const fetch = require('node-fetch'); | 9 | const fetch = require('node-fetch'); |
10 | const uuid = require('uuid/v4'); | 10 | const uuid = require('uuid/v4'); |
11 | const crypto = require('crypto'); | 11 | const crypto = require('crypto'); |
12 | const { DEFAULT_APP_SETTINGS } = require('../../../../environment'); | ||
12 | 13 | ||
13 | const apiRequest = (url, route, method, auth) => new Promise((resolve, reject) => { | 14 | const apiRequest = (url, route, method, auth) => new Promise((resolve, reject) => { |
14 | const base = `${url}/v1/`; | 15 | const base = `${url}/v1/`; |
@@ -92,7 +93,7 @@ class UserController { | |||
92 | id: '82c1cf9d-ab58-4da2-b55e-aaa41d2142d8', | 93 | id: '82c1cf9d-ab58-4da2-b55e-aaa41d2142d8', |
93 | isSubscriptionOwner: true, | 94 | isSubscriptionOwner: true, |
94 | lastname: 'Application', | 95 | lastname: 'Application', |
95 | locale: 'en-US', | 96 | locale: DEFAULT_APP_SETTINGS.fallbackLocale, |
96 | ...settings || {}, | 97 | ...settings || {}, |
97 | }); | 98 | }); |
98 | } | 99 | } |
@@ -128,7 +129,7 @@ class UserController { | |||
128 | id: '82c1cf9d-ab58-4da2-b55e-aaa41d2142d8', | 129 | id: '82c1cf9d-ab58-4da2-b55e-aaa41d2142d8', |
129 | isSubscriptionOwner: true, | 130 | isSubscriptionOwner: true, |
130 | lastname: 'Application', | 131 | lastname: 'Application', |
131 | locale: 'en-US', | 132 | locale: DEFAULT_APP_SETTINGS.fallbackLocale, |
132 | ...newSettings, | 133 | ...newSettings, |
133 | }, | 134 | }, |
134 | status: [ | 135 | status: [ |
diff --git a/src/webview/spellchecker.js b/src/webview/spellchecker.js index b59319495..0f4715207 100644 --- a/src/webview/spellchecker.js +++ b/src/webview/spellchecker.js | |||
@@ -1,6 +1,6 @@ | |||
1 | import { getCurrentWebContents } from '@electron/remote'; | 1 | import { getCurrentWebContents } from '@electron/remote'; |
2 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; | 2 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; |
3 | import { isMac } from '../environment'; | 3 | import { DEFAULT_APP_SETTINGS, isMac } from '../environment'; |
4 | 4 | ||
5 | const debug = require('debug')('Ferdi:spellchecker'); | 5 | const debug = require('debug')('Ferdi:spellchecker'); |
6 | 6 | ||
@@ -33,7 +33,7 @@ export function switchDict(locale) { | |||
33 | locales.push(foundLocale); | 33 | locales.push(foundLocale); |
34 | } | 34 | } |
35 | 35 | ||
36 | locales.push(defaultLocale, 'de'); | 36 | locales.push(defaultLocale, DEFAULT_APP_SETTINGS.fallbackLocale); |
37 | 37 | ||
38 | webContents.session.setSpellCheckerLanguages(locales); | 38 | webContents.session.setSpellCheckerLanguages(locales); |
39 | } | 39 | } |