diff options
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/index.ts b/src/index.ts index 05e222a25..7c80ca955 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -45,6 +45,7 @@ import './electron/exception'; | |||
45 | import { asarPath } from './helpers/asar-helpers'; | 45 | import { asarPath } from './helpers/asar-helpers'; |
46 | import { openExternalUrl } from './helpers/url-helpers'; | 46 | import { openExternalUrl } from './helpers/url-helpers'; |
47 | import userAgent from './helpers/userAgent-helpers'; | 47 | import userAgent from './helpers/userAgent-helpers'; |
48 | import { translateTo } from './helpers/translation-helpers'; | ||
48 | 49 | ||
49 | const debug = require('./preload-safe-debug')('Ferdium:App'); | 50 | const debug = require('./preload-safe-debug')('Ferdium:App'); |
50 | 51 | ||
@@ -500,6 +501,18 @@ app.on('login', (event, _webContents, _request, authInfo, callback) => { | |||
500 | } | 501 | } |
501 | }); | 502 | }); |
502 | 503 | ||
504 | ipcMain.handle( | ||
505 | 'translate', | ||
506 | async (_e, { text, translateToLanguage, translatorEngine }) => { | ||
507 | const response = await translateTo( | ||
508 | text, | ||
509 | translateToLanguage, | ||
510 | translatorEngine, | ||
511 | ); | ||
512 | return response; | ||
513 | }, | ||
514 | ); | ||
515 | |||
503 | // TODO: evaluate if we need to store the authCallback for every service | 516 | // TODO: evaluate if we need to store the authCallback for every service |
504 | ipcMain.on('feature-basic-auth-credentials', (_e, { user, password }) => { | 517 | ipcMain.on('feature-basic-auth-credentials', (_e, { user, password }) => { |
505 | debug('Received basic auth credentials', user, '********'); | 518 | debug('Received basic auth credentials', user, '********'); |