mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-18 22:45:59 +01:00
A review against WCAG 2.2 AA left places a screen reader user could not work: - Key bindings: a key's button says the command and the key, the clear button which command it clears; a new key is said aloud and focus comes back to its row. The on-screen keyboard is reached with Tab and walked with the arrows. - Number fields read their label; the spin buttons are named and left out of Tab. - Dialogs: Enter presses the main button, Esc closes, focus starts on the first button and the message is read with it. - Consist: every change is said - added, removed, turned, moved, replaced, undone - and the strip is a named list; a turned card says so. - Searches say how many entries are left once typing pauses. - Hasler tapes, the black box timeline, timetable and cab panel take focus, work from the keyboard, read their value as it changes and draw a focus frame. - Section reset and level controls, the crew button and the tabs carry names; English names from Avalonia's templates are read in the starter's language; sort and crew menus are radio items. - Input borders reach 3:1 against the panels; Tab starts at the top bar; the splash screen has a title and its progress reads the loading step.
29 lines
852 B
C#
29 lines
852 B
C#
using System;
|
|
using StarterNG.Application;
|
|
|
|
namespace StarterNG.Controls;
|
|
|
|
/// <summary>
|
|
/// The starter's texts as the controls here read them: in its language once the
|
|
/// application is built, the key itself before that, as in a test.
|
|
/// </summary>
|
|
internal static class AppLanguage
|
|
{
|
|
public static string Text(string key) => AppServices.CurrentOrNull?.Localization[key] ?? key;
|
|
|
|
/// <summary>Raised when the language is changed; nothing is raised before the application is built.</summary>
|
|
public static event Action? Changed
|
|
{
|
|
add
|
|
{
|
|
if (AppServices.CurrentOrNull?.Localization is { } loc)
|
|
loc.LanguageChanged += value;
|
|
}
|
|
remove
|
|
{
|
|
if (AppServices.CurrentOrNull?.Localization is { } loc)
|
|
loc.LanguageChanged -= value;
|
|
}
|
|
}
|
|
}
|