feat: Server side translation setup (#4657)

* Server side translation setup

* docs
This commit is contained in:
Tom Moor
2023-01-07 11:52:09 -08:00
committed by GitHub
parent a333f48102
commit 53414ec3ba
13 changed files with 185 additions and 78 deletions

View File

@@ -9,6 +9,7 @@ import mount from "koa-mount";
import enforceHttps, { xForwardedProtoResolver } from "koa-sslify";
import env from "@server/env";
import Logger from "@server/logging/Logger";
import { initI18n } from "@server/utils/i18n";
import routes from "../routes";
import api from "../routes/api";
import auth from "../routes/auth";
@@ -37,6 +38,8 @@ if (env.CDN_URL) {
}
export default function init(app: Koa = new Koa()): Koa {
initI18n();
if (isProduction) {
// Force redirect to HTTPS protocol unless explicitly disabled
if (env.FORCE_HTTPS) {