Skip to content
This repository was archived by the owner on Jun 9, 2022. It is now read-only.

Commit ec244f0

Browse files
author
Lily2point0
committed
remove Google from multi translator + force cache check on demo pages
1 parent 6ca0c1d commit ec244f0

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

bin/lib/translators/multi-translator.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ if (process.env.NODE_ENV !== 'production') require('dotenv').config();
33
const Utils = require('../utils/utils');
44

55
const Deepl = require('./deepl').init(Utils.processEnv('DEEPL_API_KEY'));
6-
const Google = require('./google').init(Utils.processEnv('GOOGLE_PROJECT_ID'));
76
const AWS = require('./aws').init();
87
const SETTINGS = require('../utils/translator-settings');
98
const Tracking = require('../utils/tracking');
109

11-
const translatorEntities = [Deepl, Google, AWS];
10+
const translatorEntities = [Deepl, AWS];
1211
const translatorMap = {}; // unpack entity info into useful structure
1312

1413
translatorEntities.map( entity => {

index.js

-4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ if (process.env.NODE_ENV === 'production') {
2626
app.use(bodyParser.json());
2727
app.use(bodyParser.urlencoded({ extended: false }));
2828

29-
const googleTokenPath = path.resolve(`${__dirname}/keyfile.json`);
30-
fs.writeFileSync(googleTokenPath, Utils.processEnv('GOOGLE_CREDS'));
31-
3229
const CAPI = require('./bin/lib/ft/capi').init(Utils.processEnv('FT_API_KEY'));
3330
const Translator = require('./bin/lib/translators/multi-translator');
3431
const Audio = require('./bin/lib/utils/get-audio');
@@ -82,7 +79,6 @@ app.post('/article/:uuid/:lang', (req, res, next) => {
8279
res.langFrom = req.body.from;
8380
const fromCache = req.body.fromCache;
8481
const checkCache = req.body.checkCache;
85-
8682
res.translators = JSON.parse(req.body.translators);
8783

8884
if (fromCache) {

public/js/componentSecondIteration/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function showTranslation(language) {
192192
'Content-Type': 'application/x-www-form-urlencoded'
193193
},
194194
method: 'POST',
195-
body: `translators=${JSON.stringify([translator])}&from=en`
195+
body: `translators=${JSON.stringify([translator])}&from=en&checkCache=true`
196196
};
197197

198198
if (localTranslations[`${languageCode.toLowerCase()}`]) {

0 commit comments

Comments
 (0)