Adds localization to Lumina.Presentation.Web project

This commit is contained in:
BinaryAlley committed 2024-11-20 21:08:34 +02:00
1 parent 771fa74991
commit 2c31fd8714
65 files changed
+1111 -319

No files matched your search

@@ -14,7 +14,7 @@ namespace Lumina.Presentation.Web.Controllers.FileSystemManagement;
/// Controller for managing file system paths.
/// </summary>
[Authorize]
[Route("[controller]")]
[Route("path")]
public class PathController : Controller
{
private readonly IApiHttpClient _apiHttpClient;
@@ -36,7 +36,7 @@ public class PathController : Controller
[HttpGet("get-path-root")]
public async Task<IActionResult> GetPathRoot([FromQuery] string path, CancellationToken cancellationToken)
{
PathSegmentModel response = await _apiHttpClient.GetAsync<PathSegmentModel>($"path/get-path-root?path={Uri.EscapeDataString(path)}", cancellationToken);
PathSegmentModel response = await _apiHttpClient.GetAsync<PathSegmentModel>($"path/get-path-root?path={Uri.EscapeDataString(path)}", cancellationToken).ConfigureAwait(false);
return Json(new { success = true, data = new { root = response } });
}
@@ -47,7 +47,7 @@ public class PathController : Controller
[HttpGet("get-path-separator")]
public async Task<IActionResult> GetPathSeparator(CancellationToken cancellationToken)
{
PathSeparatorModel response = await _apiHttpClient.GetAsync<PathSeparatorModel>($"path/get-path-separator", cancellationToken);
PathSeparatorModel response = await _apiHttpClient.GetAsync<PathSeparatorModel>($"path/get-path-separator", cancellationToken).ConfigureAwait(false);
return Json(new { success = true, data = new { pathSeparator = response.Separator } });
}
@@ -59,7 +59,7 @@ public class PathController : Controller
[HttpGet("get-path-parent")]
public async Task<IActionResult> GetPathParent([FromQuery] string path, CancellationToken cancellationToken)
{
PathSegmentModel[] response = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/get-path-parent?path={Uri.EscapeDataString(path)}", cancellationToken);
PathSegmentModel[] response = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/get-path-parent?path={Uri.EscapeDataString(path)}", cancellationToken).ConfigureAwait(false);
return Json(new { success = true, data = new { pathSegments = response } });
}
@@ -71,7 +71,7 @@ public class PathController : Controller
[HttpGet("split")]
public async Task<IActionResult> SplitPath([FromQuery] string path, CancellationToken cancellationToken)
{
PathSegmentModel[] response = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/split?path={Uri.EscapeDataString(path)}", cancellationToken);
PathSegmentModel[] response = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/split?path={Uri.EscapeDataString(path)}", cancellationToken).ConfigureAwait(false);
return Json(new { success = true, data = new { pathSegments = response } });
}
@@ -83,7 +83,7 @@ public class PathController : Controller
[HttpGet("validate")]
public async Task<IActionResult> ValidatePath([FromQuery] string path, CancellationToken cancellationToken)
{
PathValidModel response = await _apiHttpClient.GetAsync<PathValidModel>($"path/validate?path={Uri.EscapeDataString(path)}", cancellationToken);
PathValidModel response = await _apiHttpClient.GetAsync<PathValidModel>($"path/validate?path={Uri.EscapeDataString(path)}", cancellationToken).ConfigureAwait(false);
return Json(new { success = true, data = new { isValid = response.IsValid } });
}
@@ -96,7 +96,8 @@ public class PathController : Controller
[HttpGet("check-path-exists")]
public async Task<IActionResult> CheckPathExists([FromQuery] string path, [FromQuery] bool includeHiddenElements, CancellationToken cancellationToken)
{
PathExistsModel response = await _apiHttpClient.GetAsync<PathExistsModel>($"path/check-path-exists?path={Uri.EscapeDataString(path)}&includeHiddenElements={includeHiddenElements}", cancellationToken);
PathExistsModel response = await _apiHttpClient.GetAsync<PathExistsModel>(
$"path/check-path-exists?path={Uri.EscapeDataString(path)}&includeHiddenElements={includeHiddenElements}", cancellationToken).ConfigureAwait(false);
return Json(new { success = true, data = new { exists = response.Exists } });
}
}