aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts13
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';
45import { asarPath } from './helpers/asar-helpers'; 45import { asarPath } from './helpers/asar-helpers';
46import { openExternalUrl } from './helpers/url-helpers'; 46import { openExternalUrl } from './helpers/url-helpers';
47import userAgent from './helpers/userAgent-helpers'; 47import userAgent from './helpers/userAgent-helpers';
48import { translateTo } from './helpers/translation-helpers';
48 49
49const debug = require('./preload-safe-debug')('Ferdium:App'); 50const 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
504ipcMain.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
504ipcMain.on('feature-basic-auth-credentials', (_e, { user, password }) => { 517ipcMain.on('feature-basic-auth-credentials', (_e, { user, password }) => {
505 debug('Received basic auth credentials', user, '********'); 518 debug('Received basic auth credentials', user, '********');