Added tweet translation mechanism (#96)

* Added tweet translation mechanism.

* Removed test translation.

It was done via Google Translate which I don't trust for this application.
This commit is contained in:
G Queiroz
2022-06-01 00:06:53 -03:00
committed by GitHub
parent 3687239cd9
commit 93743fc532
15 changed files with 1363 additions and 46 deletions

View File

@@ -10,6 +10,7 @@ const { sortBy } = require('lodash');
const getEngines = require('./engines');
const primeTweets = require('./page-tweets');
const i18nTweets = require('./page-tweets').i18n;
const pageWriter = require('./page-writer');
const pageConcatinator = require('./page-concatinator');
const evaluate = require('./evaluate');
@@ -52,6 +53,9 @@ exports.everything = function (prod = false) {
posts = sortBy(posts, 'date');
posts.reverse();
// Process i18n for tweets
await i18nTweets();
const assets = [ ...PostFiles.assets, ...PublicFiles.assets ];
const [ tasks ] = await Promise.all([
@@ -126,6 +130,28 @@ exports.pages = function () {
return fn;
};
let twitterProcessing = false;
exports.twitter = function () {
async function fn () {
if (twitterProcessing) {
return;
}
twitterProcessing = true;
try {
await i18nTweets();
} catch (exception_var) {
twitterProcessing = false;
throw exception_var;
}
twitterProcessing = false;
}
fn.displayName = 'buildTwitter';
return fn;
};
exports.task = function (action, prod = false) {
const fn = async () => {
const tasks = await {