mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-29 15:51:35 +00:00
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:
parent
1f76e43446
commit
496d53f47e
22 changed files with 319 additions and 54 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue