Added a signature legal agreement warning and integrated the resource file (resx) as a JavaScript object into the _Layout.cshtml file. This enables the agreement warning to support multiple languages.

This commit is contained in:
Developer 02
2024-05-31 09:39:31 +02:00
parent 21934928c2
commit c31f081208
7 changed files with 128 additions and 53 deletions

View File

@@ -1,4 +1,9 @@
<!DOCTYPE html>
@using DigitalData.Core.API
@using Newtonsoft.Json
@{
var nonce = _accessor.HttpContext?.Items["csp-nonce"] as string;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
@@ -24,6 +29,13 @@
<script src="~/js/util.js" asp-append-version="true"></script>
<script src="~/js/api.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
@{
var lStrsJson = JsonConvert.SerializeObject(_localizer.ToDictionary()).TrySanitize(_sanitizer);
}
<script nonce="@nonce">
var localized = @Html.Raw(lStrsJson)
</script>
<main role="main">
<partial name="_CookieConsentPartial" />
@RenderBody()