Add deletion messages localization and usage

Introduce ErrorDeletingTitle and SuccessfulDeletionMessage localization entries across English, French, German, Spanish, and Ukrainian files and expose corresponding properties in LocalizationManager. Update DashboardViewModel to use these localized strings (SuccessfulDeletionMessage via string.Format and ErrorDeletingTitle) instead of hardcoded messages when notifying the user and showing error dialogs.
This commit is contained in:
primetime43 2026-05-18 20:15:36 -04:00
parent f990910865
commit 903bea8814
7 changed files with 18 additions and 2 deletions

View file

@ -152,5 +152,7 @@ public partial class LocalizationManager
[nameof(ErrorPullingChannelsTitle)] = "Error pulling channels",
[nameof(ErrorExportingTitle)] = "Error exporting channel(s)",
[nameof(SuccessfulExportMessage)] = "Successfully exported {0} channel(s)",
[nameof(ErrorDeletingTitle)] = "Error deleting messages",
[nameof(SuccessfulDeletionMessage)] = "Deleted {0} message(s), {1} failed",
};
}

View file

@ -154,5 +154,7 @@ public partial class LocalizationManager
[nameof(ErrorPullingChannelsTitle)] = "Erreur lors du chargement des canaux",
[nameof(ErrorExportingTitle)] = "Erreur lors de l'exportation des canaux",
[nameof(SuccessfulExportMessage)] = "{0} canal(-aux) exporté(s) avec succès",
[nameof(ErrorDeletingTitle)] = "Erreur lors de la suppression des messages",
[nameof(SuccessfulDeletionMessage)] = "{0} message(s) supprimé(s), {1} échec(s)",
};
}

View file

@ -158,5 +158,7 @@ public partial class LocalizationManager
[nameof(ErrorPullingChannelsTitle)] = "Fehler beim Laden der Kanäle",
[nameof(ErrorExportingTitle)] = "Fehler beim Exportieren der Kanäle",
[nameof(SuccessfulExportMessage)] = "{0} Kanal/-äle erfolgreich exportiert",
[nameof(ErrorDeletingTitle)] = "Fehler beim Löschen der Nachrichten",
[nameof(SuccessfulDeletionMessage)] = "{0} Nachricht(en) gelöscht, {1} fehlgeschlagen",
};
}

View file

@ -152,5 +152,7 @@ public partial class LocalizationManager
[nameof(ErrorPullingChannelsTitle)] = "Error al cargar canales",
[nameof(ErrorExportingTitle)] = "Error al exportar canal(es)",
[nameof(SuccessfulExportMessage)] = "{0} canal(es) exportado(s) con éxito",
[nameof(ErrorDeletingTitle)] = "Error al eliminar mensajes",
[nameof(SuccessfulDeletionMessage)] = "{0} mensaje(s) eliminado(s), {1} fallido(s)",
};
}

View file

@ -151,5 +151,7 @@ public partial class LocalizationManager
[nameof(ErrorPullingChannelsTitle)] = "Помилка завантаження каналів",
[nameof(ErrorExportingTitle)] = "Помилка експорту каналу(-ів)",
[nameof(SuccessfulExportMessage)] = "Успішно експортовано {0} канал(-ів)",
[nameof(ErrorDeletingTitle)] = "Помилка видалення повідомлень",
[nameof(SuccessfulDeletionMessage)] = "Видалено {0} повідомлення(-ь), {1} не вдалося",
};
}

View file

@ -162,4 +162,6 @@ public partial class LocalizationManager
public string ErrorPullingChannelsTitle => Get();
public string ErrorExportingTitle => Get();
public string SuccessfulExportMessage => Get();
public string ErrorDeletingTitle => Get();
public string SuccessfulDeletionMessage => Get();
}

View file

@ -430,13 +430,17 @@ public partial class DashboardViewModel : ViewModelBase
);
_snackbarManager.Notify(
$"Deleted {totalDeletedCount} message(s), {totalFailedCount} failed"
string.Format(
LocalizationManager.SuccessfulDeletionMessage,
totalDeletedCount,
totalFailedCount
)
);
}
catch (Exception ex)
{
var dialog = _viewModelManager.GetMessageBoxViewModel(
"Error deleting messages",
LocalizationManager.ErrorDeletingTitle,
ex.ToString()
);