diff --git a/src/Lumina.Presentation.Web/Common/Filters/ActionFilters/StoreLastViewFilter.cs b/src/Lumina.Presentation.Web/Common/Filters/ActionFilters/StoreLastViewFilter.cs
index cb8946be..046879ac 100644
--- a/src/Lumina.Presentation.Web/Common/Filters/ActionFilters/StoreLastViewFilter.cs
+++ b/src/Lumina.Presentation.Web/Common/Filters/ActionFilters/StoreLastViewFilter.cs
@@ -14,18 +14,18 @@ namespace Lumina.Presentation.Web.Common.Filters.ActionFilters;
public class StoreLastViewFilter : IActionFilter
{
///
- /// Executes before the action method is called
+ /// Executes before the action method is called.
///
- /// The action executing context
+ /// The action executing context.
public void OnActionExecuting(ActionExecutingContext context)
{
// no action needed before execution
}
///
- /// Executes after the action method is called
+ /// Executes after the action method is called.
///
- /// The action executed context containing the action result
+ /// The action executed context containing the action result.
public void OnActionExecuted(ActionExecutedContext context)
{
if (context.Result is ViewResult)
diff --git a/src/Lumina.Presentation.Web/Views/Shared/_NavMenu.cshtml b/src/Lumina.Presentation.Web/Views/Shared/_NavMenu.cshtml
index b50817b8..a0312546 100644
--- a/src/Lumina.Presentation.Web/Views/Shared/_NavMenu.cshtml
+++ b/src/Lumina.Presentation.Web/Views/Shared/_NavMenu.cshtml
@@ -80,15 +80,15 @@
@_localizer["Language"]
@if (User?.Identity?.IsAuthenticated == true)
{
@@ -183,15 +183,15 @@
@if (User?.Identity?.IsAuthenticated == true)
diff --git a/src/Lumina.Presentation.Web/wwwroot/js/site.js b/src/Lumina.Presentation.Web/wwwroot/js/site.js
index d4f055e0..0be3ccdc 100644
--- a/src/Lumina.Presentation.Web/wwwroot/js/site.js
+++ b/src/Lumina.Presentation.Web/wwwroot/js/site.js
@@ -393,6 +393,7 @@ async function updateContentAsync(url, addToHistory) {
const state = { url, content, title };
history.pushState(state, title, url);
}
+ updateLanguageUrls();
}
} catch (error) {
notificationService.show(jsLocalizedMessages.navigationFailed, NotificationType.ERROR);
@@ -400,6 +401,15 @@ async function updateContentAsync(url, addToHistory) {
}
}
+// Update language switcher links with the current URL
+function updateLanguageUrls() {
+ document.querySelectorAll('a.lang-set').forEach(link => {
+ const url = new URL(link.href);
+ url.searchParams.set('returnUrl', window.location.pathname + window.location.search);
+ link.href = url.toString();
+ });
+}
+
//+======================================================================================+
//| Common Helper Functions |
//+======================================================================================+