Add missing translations in web app (#1155)

This commit is contained in:
Leendert de Borst
2025-08-28 23:20:03 +02:00
committed by Leendert de Borst
parent 6a75e56123
commit 1cf28c43fb
6 changed files with 38 additions and 8 deletions

View File

@@ -1,13 +1,17 @@
@using System.Text.RegularExpressions
@using Microsoft.Extensions.Localization
@inject IStringLocalizerFactory LocalizerFactory
<div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
<h3 class="mb-4 text-xl font-semibold dark:text-white">Notes</h3>
<h3 class="mb-4 text-xl font-semibold dark:text-white">@SharedLocalizer["Notes"]</h3>
<div class="dark:text-gray-300">
@((MarkupString)ConvertUrlsToLinks(Notes).Replace(Environment.NewLine, "<br>"))
</div>
</div>
@code {
private IStringLocalizer SharedLocalizer => LocalizerFactory.Create("SharedResources", "AliasVault.Client");
/// <summary>
/// The notes to display.
/// </summary>

View File

@@ -1,9 +1,11 @@
@inject DbService DbService
@using Microsoft.Extensions.Localization
@inject DbService DbService
@inject AuthService AuthService
@inject NavigationManager NavigationManager
@inject IStringLocalizerFactory LocalizerFactory
<div class="ms-2 items-center hidden lg:flex">
<button class="p-2 hover:bg-gray-200 rounded-2xl" @onclick="OnLockClick" title="Lock vault">
<button class="p-2 hover:bg-gray-200 rounded-2xl" @onclick="OnLockClick" title="@SharedLocalizer["LockVault"]">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-gray-400" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd" />
</svg>
@@ -11,6 +13,8 @@
</div>
@code {
private IStringLocalizer SharedLocalizer => LocalizerFactory.Create("SharedResources", "AliasVault.Client");
/// <summary>
/// Lock the database.
/// </summary>

View File

@@ -1,8 +1,10 @@
@implements IDisposable
@using Microsoft.Extensions.Localization
@implements IDisposable
@inject DbService DbService
@inject IStringLocalizerFactory LocalizerFactory
<div class="ms-1 items-center flex">
<SmallLoadingIndicator Title="Sync vault data" Spinning="@Loading">
<SmallLoadingIndicator Title="@SharedLocalizer["SyncVaultData"]" Spinning="@Loading">
@if (!Loading)
{
<button class="absolute p-2 hover:bg-gray-200 rounded-2xl" id="vault-refresh-btn" @onclick="OnRefreshClick">
@@ -15,6 +17,8 @@
</div>
@code {
private IStringLocalizer SharedLocalizer => LocalizerFactory.Create("SharedResources", "AliasVault.Client");
private bool Loading { get; set; } = false;
private string LoadingIndicatorMessage { get; set; } = "";
private bool DatabaseLoading { get; set; } = false;

View File

@@ -117,7 +117,7 @@ public abstract class MainBase : OwningComponentBase
_parametersInitialSet = false;
// Add base breadcrumbs
BreadcrumbItems.Add(new BreadcrumbItem { DisplayName = "Home", Url = NavigationManager.BaseUri });
BreadcrumbItems.Add(new BreadcrumbItem { DisplayName = SharedLocalizer["Home"], Url = NavigationManager.BaseUri });
bool willRedirect = await RedirectIfNoEncryptionKey();
if (willRedirect)

View File

@@ -42,7 +42,7 @@
<div class="flex space-x-3">
<Button Type="submit" Color="danger">@Localizer["ContinueWithAccountDeletion"]</Button>
<Button Type="button" Color="secondary" OnClick="Cancel">Cancel</Button>
<Button Type="button" Color="secondary" OnClick="Cancel">@SharedLocalizer["Cancel"]</Button>
</div>
</EditForm>
</div>
@@ -70,7 +70,7 @@
<div class="flex space-x-3">
<Button Type="submit" Color="danger">@Localizer["DeleteMyAccount"]</Button>
<Button Type="button" Color="secondary" OnClick="Cancel">Cancel</Button>
<Button Type="button" Color="secondary" OnClick="Cancel">@SharedLocalizer["Cancel"]</Button>
</div>
</EditForm>
</div>

View File

@@ -293,4 +293,22 @@
<value>Password is required</value>
<comment>Error message when password is required</comment>
</data>
<!-- General UI text -->
<data name="LockVault" xml:space="preserve">
<value>Lock vault</value>
<comment>Tooltip text for lock vault button</comment>
</data>
<data name="Home" xml:space="preserve">
<value>Home</value>
<comment>Home breadcrumb text</comment>
</data>
<data name="Notes" xml:space="preserve">
<value>Notes</value>
<comment>Notes section heading</comment>
</data>
<data name="SyncVaultData" xml:space="preserve">
<value>Sync vault data</value>
<comment>Tooltip text for sync vault data button</comment>
</data>
</root>