Create initial language support

Create support for languages, then reformat user, home, and post pages
to use it, and create en and en-us language files.
This commit is contained in:
Cadence Ember
2020-07-20 01:40:27 +12:00
parent 1f76e43446
commit 496d53f47e
22 changed files with 319 additions and 54 deletions

View File

@@ -1,4 +1,5 @@
const constants = require("../../lib/constants")
const lang = require("../../lang")
const switcher = require("../../lib/utils/torswitcher")
const {fetchUser, getOrFetchShortcode, userRequestCache, history, assistantSwitcher} = require("../../lib/collectors")
const {render, redirect, getStaticURL} = require("pinski/plugins")
@@ -112,7 +113,8 @@ module.exports = [
username,
expiresMinutes: userRequestCache.getTtl("user/"+username, 1000*60),
getStaticURL,
settings
settings,
lang
})
}
} else if (error === constants.symbols.extractor_results.AGE_RESTRICTED) {
@@ -179,7 +181,7 @@ module.exports = [
contentType: "application/json",
content: {
title: getPageTitle(post),
html: pugCache.get("pug/fragments/post.pug").web({post, settings, getStaticURL})
html: pugCache.get("pug/fragments/post.pug").web({lang, post, settings, getStaticURL})
}
}
}).catch(error => {