diff --git a/i18n/en/About.resx b/i18n/en/About.resx
index 37466cd9..fe6b0d73 100644
--- a/i18n/en/About.resx
+++ b/i18n/en/About.resx
@@ -27,6 +27,7 @@
Download failedDownloading {0:P0}Check failed
+ Downloading…Download not verifiedTitano {0} downloadedShow file
diff --git a/i18n/en/Jobs.resx b/i18n/en/Jobs.resx
index b8ab8847..9e6c4cd8 100644
--- a/i18n/en/Jobs.resx
+++ b/i18n/en/Jobs.resx
@@ -56,6 +56,7 @@
Pause allRendering settings{0} · {1}
+ {0}: {1}invariantSearch target or kind{0} fps{0}/s
diff --git a/i18n/en/Server.resx b/i18n/en/Server.resx
index 341cfbb2..378cdb93 100644
--- a/i18n/en/Server.resx
+++ b/i18n/en/Server.resx
@@ -182,6 +182,7 @@
{0} uploads queued{0} count{0} received{0} percentNot compared · retrying
+ {0}: {1}invariantThis PC's settings savedlongSearchShow file
diff --git a/i18n/it/About.it.resx b/i18n/it/About.it.resx
index c290af5d..86977362 100644
--- a/i18n/it/About.it.resx
+++ b/i18n/it/About.it.resx
@@ -27,6 +27,7 @@
Download non riuscitoDownload in corso {0:P0}Verifica non riuscita
+ Download in corso…Download non verificatoTitano {0} scaricatoMostra file
diff --git a/i18n/it/Jobs.it.resx b/i18n/it/Jobs.it.resx
index ec6f193b..4524e528 100644
--- a/i18n/it/Jobs.it.resx
+++ b/i18n/it/Jobs.it.resx
@@ -56,6 +56,7 @@
Sospendi tutteImpostazioni di rendering{0} · {1}
+ {0}: {1}Cerca oggetto o tipo{0} fps{0}/s
diff --git a/i18n/it/Server.it.resx b/i18n/it/Server.it.resx
index 148043a7..14baa2bc 100644
--- a/i18n/it/Server.it.resx
+++ b/i18n/it/Server.it.resx
@@ -179,6 +179,7 @@
{0} caricamenti in coda{0} ricevutoConfronto fallito · riprovo
+ {0}: {1}Impostazioni di questo PC salvateCercaMostra file
diff --git a/src/Titano.App/Infrastructure/LiveRegion.cs b/src/Titano.App/Infrastructure/LiveRegion.cs
index 3bfdf6e2..c9129e1f 100644
--- a/src/Titano.App/Infrastructure/LiveRegion.cs
+++ b/src/Titano.App/Infrastructure/LiveRegion.cs
@@ -1,7 +1,9 @@
+using System.Globalization;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Automation.Peers;
using System.Windows.Threading;
+using Titano.Core.Localization;
namespace Titano.App.Infrastructure;
@@ -15,6 +17,13 @@ public static class LiveRegion
public static readonly DependencyProperty TextProperty = DependencyProperty.RegisterAttached(
"Text", typeof(string), typeof(LiveRegion), new PropertyMetadata(null, OnTextChanged));
+ ///
+ /// The data and language the last text came from: a recycled list row showing another item, or every status
+ /// relabelled by a language switch, is not news.
+ ///
+ private static readonly DependencyProperty SourceProperty = DependencyProperty.RegisterAttached(
+ "Source", typeof(Origin), typeof(LiveRegion), new PropertyMetadata(null));
+
public static string? GetText(DependencyObject element) => (string?)element.GetValue(TextProperty);
public static void SetText(DependencyObject element, string? value) => element.SetValue(TextProperty, value);
@@ -23,10 +32,15 @@ public static class LiveRegion
{
if (d is not FrameworkElement element) return;
AutomationProperties.SetName(element, (string?)e.NewValue ?? string.Empty);
+ var origin = new Origin(element.DataContext, Loc.Culture);
+ var sameSource = element.GetValue(SourceProperty) is Origin last && ReferenceEquals(last.Data, origin.Data) && last.Culture.Equals(origin.Culture);
+ element.SetValue(SourceProperty, origin);
// The first value arrives with the screen: only what changes while it is shown is announced, once layout has shown
// it (a status that appears with its text is still collapsed when the text arrives).
- if (!element.IsLoaded || e.NewValue is null || !AutomationPeer.ListenerExists(AutomationEvents.LiveRegionChanged)) return;
+ if (!sameSource || !element.IsLoaded || e.NewValue is null || !AutomationPeer.ListenerExists(AutomationEvents.LiveRegionChanged)) return;
element.Dispatcher.InvokeAsync(() => UIElementAutomationPeer.CreatePeerForElement(element)?.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged),
DispatcherPriority.Background);
}
+
+ private sealed record Origin(object? Data, CultureInfo Culture);
}
diff --git a/src/Titano.App/Jobs/JobRowViewModel.cs b/src/Titano.App/Jobs/JobRowViewModel.cs
index 5f9a5e2e..6893f915 100644
--- a/src/Titano.App/Jobs/JobRowViewModel.cs
+++ b/src/Titano.App/Jobs/JobRowViewModel.cs
@@ -53,6 +53,9 @@ public sealed class JobRowViewModel : ObservableObject
public string StateText => JobText.State(_entry);
+ /// "Render · Harbour sunset: done · 3:00": what a screen reader announces when the state changes (not progress).
+ public string StateAnnouncement => Loc.L("Jobs.Row.State", AccessibleName, StateText);
+
/// Glyph and colour of the state (paired with the word, never colour alone).
public StatusKind StateKind => _entry.State switch
{
@@ -131,6 +134,7 @@ public sealed class JobRowViewModel : ObservableObject
OnPropertyChanged(nameof(LeftText));
OnPropertyChanged(nameof(WhereText));
OnPropertyChanged(nameof(StateText));
+ OnPropertyChanged(nameof(StateAnnouncement));
if (_isExpanded) OnPropertyChanged(nameof(LogText));
}
diff --git a/src/Titano.App/Sections/AboutView.xaml b/src/Titano.App/Sections/AboutView.xaml
index bf79c9a9..ac29b3b4 100644
--- a/src/Titano.App/Sections/AboutView.xaml
+++ b/src/Titano.App/Sections/AboutView.xaml
@@ -58,7 +58,7 @@
+ AutomationProperties.LiveSetting="Polite" infra:LiveRegion.Text="{Binding UpdateAnnouncement}" />
diff --git a/src/Titano.App/Sections/AboutViewModel.cs b/src/Titano.App/Sections/AboutViewModel.cs
index f11240da..1ed7fe2f 100644
--- a/src/Titano.App/Sections/AboutViewModel.cs
+++ b/src/Titano.App/Sections/AboutViewModel.cs
@@ -81,6 +81,9 @@ public sealed class AboutViewModel : SectionViewModel
_ => null,
};
+ /// What screen readers announce: each new state, not each percent of a download.
+ public string? UpdateAnnouncement => _update.State == UpdateState.Downloading ? Loc.L("About.Update.InProgress") : UpdateText;
+
public StatusKind UpdateKind => _update.State switch
{
UpdateState.Checking or UpdateState.Downloading => StatusKind.Running,
@@ -137,6 +140,7 @@ public sealed class AboutViewModel : SectionViewModel
private void RaiseUpdate()
{
OnPropertyChanged(nameof(UpdateText));
+ OnPropertyChanged(nameof(UpdateAnnouncement));
OnPropertyChanged(nameof(UpdateKind));
OnPropertyChanged(nameof(HasUpdateText));
OnPropertyChanged(nameof(IsUpdateAvailable));
diff --git a/src/Titano.App/Sections/JobsView.xaml b/src/Titano.App/Sections/JobsView.xaml
index fde705da..d7d353e5 100644
--- a/src/Titano.App/Sections/JobsView.xaml
+++ b/src/Titano.App/Sections/JobsView.xaml
@@ -4,6 +4,7 @@
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
xmlns:s="clr-namespace:Titano.App.Sections"
+ xmlns:infra="clr-namespace:Titano.App.Infrastructure"
xmlns:j="clr-namespace:Titano.App.Jobs">