fix: Correct HTML lang attribute in source. closes #6534

This commit is contained in:
Tom Moor
2024-02-16 12:44:17 -05:00
parent 69eb7b9db4
commit 2b0a8d1f7c
3 changed files with 13 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import escape from "lodash/escape";
import { Sequelize } from "sequelize";
import isUUID from "validator/lib/isUUID";
import { IntegrationType, TeamPreference } from "@shared/types";
import { unicodeCLDRtoISO639 } from "@shared/utils/date";
import documentLoader from "@server/commands/documentLoader";
import env from "@server/env";
import { Integration } from "@server/models";
@@ -91,6 +92,7 @@ export const renderApp = async (
ctx.body = page
.toString()
.replace(/\{env\}/g, environment)
.replace(/\{lang\}/g, unicodeCLDRtoISO639(env.DEFAULT_LANGUAGE))
.replace(/\{title\}/g, escape(title))
.replace(/\{description\}/g, escape(description))
.replace(/\{canonical-url\}/g, canonical)

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="{lang}">
<head>
<title>{title}</title>
<meta name="theme-color" content="#FFF" />