Add localization for cookie consent modal
Added localized strings for the cookie consent modal in de-DE, en-US, and fr-FR resource files. Updated _CookieConsentPartial.cshtml to use these resources for the modal title, message, and accept button, enabling multilingual support. Injected IStringLocalizer to support string localization in the view.
This commit is contained in:
@@ -321,4 +321,13 @@
|
||||
<data name="ShrEnvOperationFailedText" xml:space="preserve">
|
||||
<value>Der Vorgang ist fehlgeschlagen. Bitte wenden Sie sich an das IT-Team.</value>
|
||||
</data>
|
||||
<data name="PrivacyNotice" xml:space="preserve">
|
||||
<value>Datenschutzhinweis</value>
|
||||
</data>
|
||||
<data name="CookieConsentMessage" xml:space="preserve">
|
||||
<value>Wir verwenden technisch notwendige Session Cookies. Diese Cookies sind für den ordnungsgemäßen Betrieb dieser Webseite von nöten und können aus diesm Grund nicht abgewählt werden. Es findet keine Übermittlung an Dritte statt.</value>
|
||||
</data>
|
||||
<data name="Accept" xml:space="preserve">
|
||||
<value>Akzeptieren</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -321,4 +321,13 @@
|
||||
<data name="ShrEnvOperationFailedText" xml:space="preserve">
|
||||
<value>The operation failed. Please contact the IT team.</value>
|
||||
</data>
|
||||
<data name="PrivacyNotice" xml:space="preserve">
|
||||
<value>Privacy notice</value>
|
||||
</data>
|
||||
<data name="CookieConsentMessage" xml:space="preserve">
|
||||
<value>We use technically necessary session cookies. These cookies are required for the proper operation of this website and therefore cannot be deselected. No data is transmitted to third parties.</value>
|
||||
</data>
|
||||
<data name="Accept" xml:space="preserve">
|
||||
<value>Accept</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -321,4 +321,13 @@
|
||||
<data name="ShrEnvOperationFailedText" xml:space="preserve">
|
||||
<value>L'opération a échoué. Veuillez contacter l'équipe informatique.</value>
|
||||
</data>
|
||||
<data name="PrivacyNotice" xml:space="preserve">
|
||||
<value>Avis de confidentialité</value>
|
||||
</data>
|
||||
<data name="CookieConsentMessage" xml:space="preserve">
|
||||
<value>Nous utilisons des cookies de session strictement nécessaires. Ces cookies sont indispensables au bon fonctionnement de ce site et ne peuvent donc pas être désactivés. Aucune donnée n'est transmise à des tiers.</value>
|
||||
</data>
|
||||
<data name="Accept" xml:space="preserve">
|
||||
<value>Accepter</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,4 +1,5 @@
|
||||
@using Microsoft.AspNetCore.Http.Features
|
||||
@inject IStringLocalizer<SharedResource> _localizer
|
||||
|
||||
@{
|
||||
var nonce = _accessor.HttpContext?.Items["csp-nonce"] as string;
|
||||
@@ -13,13 +14,13 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="staticBackdropLabel">Datenschutzhinweis</h1>
|
||||
<h1 class="modal-title fs-5" id="staticBackdropLabel">@_localizer["PrivacyNotice"]</h1>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Wir verwenden technisch notwendige Session Cookies. Diese Cookies sind für den ordnungsgemäßen Betrieb dieser Webseite von nöten und können aus diesm Grund nicht abgewählt werden. Es findet keine Übermittlung an Dritte statt.
|
||||
@_localizer["CookieConsentMessage"]
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary accept-policy close" data-bs-dismiss="modal" data-cookie-string="@cookieString"><span aria-hidden="true">Accept</span></button>
|
||||
<button type="button" class="btn btn-secondary accept-policy close" data-bs-dismiss="modal" data-cookie-string="@cookieString"><span aria-hidden="true">@_localizer["Accept"]</span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user