Merge branch 'refs/heads/master' into apiX

This commit is contained in:
Kaz Wolfe 2024-06-27 16:22:54 -07:00
commit fb4d9c5ac7
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4

View file

@ -365,7 +365,7 @@ internal class AutoUpdateManager : IServiceType
var notification = this.GetBaseNotification(new Notification var notification = this.GetBaseNotification(new Notification
{ {
Title = Locs.NotificationTitleUpdatesAvailable, Title = Locs.NotificationTitleUpdatesAvailable,
Content = Locs.NotificationContentUpdatesAvailable(updatablePlugins.Count), Content = Locs.NotificationContentUpdatesAvailable(updatablePlugins),
MinimizedText = Locs.NotificationContentUpdatesAvailableMinimized(updatablePlugins.Count), MinimizedText = Locs.NotificationContentUpdatesAvailableMinimized(updatablePlugins.Count),
Type = NotificationType.Info, Type = NotificationType.Info,
InitialDuration = TimeSpan.MaxValue, InitialDuration = TimeSpan.MaxValue,
@ -470,11 +470,18 @@ internal class AutoUpdateManager : IServiceType
public static string NotificationContentUpdatesFailed => Loc.Localize("AutoUpdateUpdatesFailedContent", "Some plugins failed to update. Please check the plugin installer for more information."); public static string NotificationContentUpdatesFailed => Loc.Localize("AutoUpdateUpdatesFailedContent", "Some plugins failed to update. Please check the plugin installer for more information.");
public static string NotificationContentUpdatesFailedMinimized => Loc.Localize("AutoUpdateUpdatesFailedContentMinimized", "Plugins failed to update."); public static string NotificationContentUpdatesFailedMinimized => Loc.Localize("AutoUpdateUpdatesFailedContentMinimized", "Plugins failed to update.");
public static string NotificationContentUpdatesAvailable(int numUpdates) public static string NotificationContentUpdatesAvailable(ICollection<AvailablePluginUpdate> updatablePlugins)
=> numUpdates == 1 ? => (updatablePlugins.Count == 1
Loc.Localize("AutoUpdateUpdatesAvailableContentSingular", "There is a plugin that can be updated.") : ? Loc.Localize(
string.Format(Loc.Localize("AutoUpdateUpdatesAvailableContentPlural", "There are {0} plugins that can be updated."), numUpdates); "AutoUpdateUpdatesAvailableContentSingular",
"There is a plugin that can be updated:")
: string.Format(
Loc.Localize(
"AutoUpdateUpdatesAvailableContentPlural",
"There are {0} plugins that can be updated:"),
updatablePlugins.Count))
+ "\n\n" + string.Join(",", updatablePlugins.Select(x => x.InstalledPlugin.Manifest.Name));
public static string NotificationContentUpdatesAvailableMinimized(int numUpdates) public static string NotificationContentUpdatesAvailableMinimized(int numUpdates)
=> numUpdates == 1 ? => numUpdates == 1 ?