mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-11-26 04:52:43 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user