diff --git a/apps/server/AliasVault.Client/Main/Components/Email/EmailModal.razor b/apps/server/AliasVault.Client/Main/Components/Email/EmailModal.razor index d8960bc3c..374a08a3c 100644 --- a/apps/server/AliasVault.Client/Main/Components/Email/EmailModal.razor +++ b/apps/server/AliasVault.Client/Main/Components/Email/EmailModal.razor @@ -3,12 +3,15 @@ @using AliasVault.Shared.Core; @using AliasVault.Client.Main.Components.Layout @using AliasVault.RazorComponents.Services +@using Microsoft.Extensions.Localization +@using AliasVault.Client.Resources @inject JsInteropService JsInteropService @inject GlobalNotificationService GlobalNotificationService @inject IHttpClientFactory HttpClientFactory @inject EmailService EmailService @inject HttpClient HttpClient @inject ConfirmModalService ConfirmModalService +@inject IStringLocalizerFactory LocalizerFactory @@ -35,12 +38,12 @@
-

From: @(Email?.FromLocal)@@@(Email?.FromDomain)

-

To: @(Email?.ToLocal)@@@(Email?.ToDomain)

+

@Localizer["FromLabel"] @(Email?.FromLocal)@@@(Email?.FromDomain)

+

@Localizer["ToLabel"] @(Email?.ToLocal)@@@(Email?.ToDomain)

-

Date: @Email?.DateSystem

-

Actions:

+

@Localizer["DateLabel"] @Email?.DateSystem

+

@Localizer["ActionsLabel"]

@@ -57,7 +60,7 @@ @if (Email?.Attachments?.Any() == true) {
-

Attachments:

+

@Localizer["AttachmentsLabel"]

@foreach (var attachment in Email.Attachments) { @@ -76,7 +79,7 @@ }
- +
@@ -84,6 +87,8 @@
@code { + private IStringLocalizer Localizer => LocalizerFactory.Create("Components.Main.Email.EmailModal", "AliasVault.Client"); + /// /// The email to show in the modal. /// @@ -124,8 +129,8 @@ } var result = await ConfirmModalService.ShowConfirmation( - "Delete Email", - "Are you sure you want to delete this email? This action cannot be undone." + Localizer["DeleteEmailTitle"], + Localizer["DeleteEmailConfirmation"] ); if (result) @@ -185,18 +190,18 @@ if (response.IsSuccessStatusCode) { await OnEmailDeleted.InvokeAsync(Email.Id); - GlobalNotificationService.AddSuccessMessage("Email deleted successfully", true); + GlobalNotificationService.AddSuccessMessage(Localizer["EmailDeletedSuccess"], true); await Close(); } else { var errorMessage = await response.Content.ReadAsStringAsync(); - GlobalNotificationService.AddErrorMessage($"Failed to delete email: {errorMessage}", true); + GlobalNotificationService.AddErrorMessage($"{Localizer["EmailDeleteFailed"]}: {errorMessage}", true); } } catch (Exception ex) { - GlobalNotificationService.AddErrorMessage($"An error occurred: {ex.Message}", true); + GlobalNotificationService.AddErrorMessage($"{Localizer["GenericError"]}: {ex.Message}", true); } } @@ -216,16 +221,16 @@ if (response.IsSuccessStatusCode) { await OnEmailDeleted.InvokeAsync(Email.Id); - GlobalNotificationService.AddSuccessMessage($"Email deleted successfully.", true); + GlobalNotificationService.AddSuccessMessage(Localizer["EmailDeletedSuccess"], true); } else { - GlobalNotificationService.AddErrorMessage($"Failed to delete email.", true); + GlobalNotificationService.AddErrorMessage(Localizer["EmailDeleteFailed"], true); } } catch (Exception ex) { - GlobalNotificationService.AddErrorMessage($"Failed to delete email: {ex.Message}", true); + GlobalNotificationService.AddErrorMessage($"{Localizer["EmailDeleteFailed"]}: {ex.Message}", true); } } @@ -251,7 +256,7 @@ else { // No HTML and no plain text available - EmailBody = "[This email has no body.]"; + EmailBody = Localizer["NoEmailBody"]; } } } @@ -278,7 +283,7 @@ } else { - GlobalNotificationService.AddErrorMessage("Failed to download attachment", true); + GlobalNotificationService.AddErrorMessage(Localizer["AttachmentDownloadFailed"], true); } } else @@ -301,13 +306,13 @@ } else { - GlobalNotificationService.AddErrorMessage("Failed to download attachment", true); + GlobalNotificationService.AddErrorMessage(Localizer["AttachmentDownloadFailed"], true); } } } catch (Exception ex) { - GlobalNotificationService.AddErrorMessage($"Error downloading attachment: {ex.Message}", true); + GlobalNotificationService.AddErrorMessage($"{Localizer["AttachmentDownloadError"]}: {ex.Message}", true); } } } diff --git a/apps/server/AliasVault.Client/Main/Components/Email/EmailPreview.razor b/apps/server/AliasVault.Client/Main/Components/Email/EmailPreview.razor index 4ef04fce4..2f4b5b262 100644 --- a/apps/server/AliasVault.Client/Main/Components/Email/EmailPreview.razor +++ b/apps/server/AliasVault.Client/Main/Components/Email/EmailPreview.razor @@ -3,12 +3,14 @@ @using AliasVault.Shared.Core; @using AliasVault.Client.Main.Components.Layout @using AliasVault.RazorComponents.Services +@using Microsoft.Extensions.Localization @inject JsInteropService JsInteropService @inject GlobalNotificationService GlobalNotificationService @inject IHttpClientFactory HttpClientFactory @inject EmailService EmailService @inject HttpClient HttpClient @inject ConfirmModalService ConfirmModalService +@inject IStringLocalizerFactory LocalizerFactory
@if (Email != null) @@ -35,14 +37,14 @@
-

From: @(Email.FromLocal)@@@(Email.FromDomain)

-

To: @(Email.ToLocal)@@@(Email.ToDomain)

+

@Localizer["FromLabel"] @(Email.FromLocal)@@@(Email.FromDomain)

+

@Localizer["ToLabel"] @(Email.ToLocal)@@@(Email.ToDomain)

-

Date: @Email.DateSystem

+

@Localizer["DateLabel"] @Email.DateSystem

@if (!string.IsNullOrEmpty(CredentialName) && CredentialId != Guid.Empty) { -

Credential: +

@Localizer["CredentialLabel"]

@@ -71,7 +73,7 @@ {
-

Attachments:

+

@Localizer["AttachmentsLabel"]

@foreach (var attachment in Email.Attachments) { @@ -97,13 +99,14 @@ -

Select an email to view its contents

+

@Localizer["SelectEmailMessage"]

}
@code { + private IStringLocalizer Localizer => LocalizerFactory.Create("Components.Main.Email.EmailPreview", "AliasVault.Client"); /// /// The email to show in the preview. /// @@ -156,8 +159,8 @@ } var result = await ConfirmModalService.ShowConfirmation( - "Delete Email", - "Are you sure you want to delete this email? This action cannot be undone." + Localizer["DeleteEmailTitle"], + Localizer["DeleteEmailConfirmation"] ); if (result) @@ -208,17 +211,17 @@ if (response.IsSuccessStatusCode) { await OnEmailDeleted.InvokeAsync(Email.Id); - GlobalNotificationService.AddSuccessMessage("Email deleted successfully", true); + GlobalNotificationService.AddSuccessMessage(Localizer["EmailDeletedSuccess"], true); } else { var errorMessage = await response.Content.ReadAsStringAsync(); - GlobalNotificationService.AddErrorMessage($"Failed to delete email: {errorMessage}", true); + GlobalNotificationService.AddErrorMessage($"{Localizer["EmailDeleteFailed"]}: {errorMessage}", true); } } catch (Exception ex) { - GlobalNotificationService.AddErrorMessage($"An error occurred: {ex.Message}", true); + GlobalNotificationService.AddErrorMessage($"{Localizer["GenericError"]}: {ex.Message}", true); } } @@ -238,16 +241,16 @@ if (response.IsSuccessStatusCode) { await OnEmailDeleted.InvokeAsync(Email.Id); - GlobalNotificationService.AddSuccessMessage($"Email deleted successfully.", true); + GlobalNotificationService.AddSuccessMessage(Localizer["EmailDeletedSuccess"], true); } else { - GlobalNotificationService.AddErrorMessage($"Failed to delete email.", true); + GlobalNotificationService.AddErrorMessage(Localizer["EmailDeleteFailed"], true); } } catch (Exception ex) { - GlobalNotificationService.AddErrorMessage($"Failed to delete email: {ex.Message}", true); + GlobalNotificationService.AddErrorMessage($"{Localizer["EmailDeleteFailed"]}: {ex.Message}", true); } } @@ -272,7 +275,7 @@ else { // No HTML and no plain text available - EmailBody = "[This email has no body.]"; + EmailBody = Localizer["NoEmailBody"]; } } } @@ -299,7 +302,7 @@ } else { - GlobalNotificationService.AddErrorMessage("Failed to download attachment", true); + GlobalNotificationService.AddErrorMessage(Localizer["AttachmentDownloadFailed"], true); } } else @@ -322,13 +325,13 @@ } else { - GlobalNotificationService.AddErrorMessage("Failed to download attachment", true); + GlobalNotificationService.AddErrorMessage(Localizer["AttachmentDownloadFailed"], true); } } } catch (Exception ex) { - GlobalNotificationService.AddErrorMessage($"Error downloading attachment: {ex.Message}", true); + GlobalNotificationService.AddErrorMessage($"{Localizer["AttachmentDownloadError"]}: {ex.Message}", true); } } } diff --git a/apps/server/AliasVault.Client/Main/Components/Email/EmailRow.razor b/apps/server/AliasVault.Client/Main/Components/Email/EmailRow.razor index 138e37443..27dd3261e 100644 --- a/apps/server/AliasVault.Client/Main/Components/Email/EmailRow.razor +++ b/apps/server/AliasVault.Client/Main/Components/Email/EmailRow.razor @@ -1,4 +1,6 @@ @using AliasVault.Client.Main.Pages.Emails.Models +@using Microsoft.Extensions.Localization +@inject IStringLocalizerFactory LocalizerFactory
  • @@ -19,7 +21,7 @@ } @if (IsNewEmail) { -
    +
    }
    @@ -41,6 +43,7 @@
  • @code { + private IStringLocalizer Localizer => LocalizerFactory.Create("Components.Main.Email.EmailRow", "AliasVault.Client"); /// /// The email model. /// diff --git a/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailModal.en.resx b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailModal.en.resx new file mode 100644 index 000000000..2a130aa05 --- /dev/null +++ b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailModal.en.resx @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + From: + Email sender field label + + + To: + Email recipient field label + + + Date: + Email date field label + + + Actions: + Email actions section label + + + Delete + Delete email button text + + + Attachments: + Email attachments section header + + + Close + Close modal button text + + + Delete Email + Delete email confirmation dialog title + + + Are you sure you want to delete this email? This action cannot be undone. + Delete email confirmation message + + + Email deleted successfully + Success message when email is deleted + + + Failed to delete email + Error message when email deletion fails + + + An error occurred + Generic error message + + + [This email has no body.] + Message shown when email has no content + + + Failed to download attachment + Error message when attachment download fails + + + Error downloading attachment + Error message for attachment download error + + \ No newline at end of file diff --git a/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailModal.nl.resx b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailModal.nl.resx new file mode 100644 index 000000000..77632abe3 --- /dev/null +++ b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailModal.nl.resx @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Van: + Email sender field label + + + Aan: + Email recipient field label + + + Datum: + Email date field label + + + Acties: + Email actions section label + + + Verwijderen + Delete email button text + + + Bijlagen: + Email attachments section header + + + Sluiten + Close modal button text + + + E-mail verwijderen + Delete email confirmation dialog title + + + Weet u zeker dat u deze e-mail wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt. + Delete email confirmation message + + + E-mail succesvol verwijderd + Success message when email is deleted + + + Verwijderen van e-mail mislukt + Error message when email deletion fails + + + Er is een fout opgetreden + Generic error message + + + [Deze e-mail heeft geen inhoud.] + Message shown when email has no content + + + Downloaden van bijlage mislukt + Error message when attachment download fails + + + Fout bij downloaden bijlage + Error message for attachment download error + + \ No newline at end of file diff --git a/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailPreview.en.resx b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailPreview.en.resx new file mode 100644 index 000000000..457dbd187 --- /dev/null +++ b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailPreview.en.resx @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + From: + Email sender field label + + + To: + Email recipient field label + + + Date: + Email date field label + + + Credential: + Email credential field label + + + None + No credential assigned value + + + Attachments: + Email attachments section header + + + Select an email to view its contents + Empty state message when no email is selected + + + Delete Email + Delete email confirmation dialog title + + + Are you sure you want to delete this email? This action cannot be undone. + Delete email confirmation message + + + Email deleted successfully + Success message when email is deleted + + + Failed to delete email + Error message when email deletion fails + + + An error occurred + Generic error message + + + [This email has no body.] + Message shown when email has no content + + + Failed to download attachment + Error message when attachment download fails + + + Error downloading attachment + Error message for attachment download error + + \ No newline at end of file diff --git a/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailPreview.nl.resx b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailPreview.nl.resx new file mode 100644 index 000000000..9a5fd63b2 --- /dev/null +++ b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailPreview.nl.resx @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Van: + Email sender field label + + + Aan: + Email recipient field label + + + Datum: + Email date field label + + + Inloggegevens: + Email credential field label + + + Geen + No credential assigned value + + + Bijlagen: + Email attachments section header + + + Selecteer een e-mail om de inhoud te bekijken + Empty state message when no email is selected + + + E-mail verwijderen + Delete email confirmation dialog title + + + Weet u zeker dat u deze e-mail wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt. + Delete email confirmation message + + + E-mail succesvol verwijderd + Success message when email is deleted + + + Verwijderen van e-mail mislukt + Error message when email deletion fails + + + Er is een fout opgetreden + Generic error message + + + [Deze e-mail heeft geen inhoud.] + Message shown when email has no content + + + Downloaden van bijlage mislukt + Error message when attachment download fails + + + Fout bij downloaden bijlage + Error message for attachment download error + + \ No newline at end of file diff --git a/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailRow.en.resx b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailRow.en.resx new file mode 100644 index 000000000..7adf152e8 --- /dev/null +++ b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailRow.en.resx @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + New email + Tooltip text for new email indicator + + \ No newline at end of file diff --git a/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailRow.nl.resx b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailRow.nl.resx new file mode 100644 index 000000000..1ed5f13d8 --- /dev/null +++ b/apps/server/AliasVault.Client/Resources/Components/Main/Email/EmailRow.nl.resx @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nieuwe e-mail + Tooltip text for new email indicator + + \ No newline at end of file