DesktopPlatformTexts record

Namespace Runic.Platform in Runic.Platform 0.23.0

public sealed record DesktopPlatformTexts : IEquatable<DesktopPlatformTexts>

Inherits or implements IEquatable.

The text that Runic itself shows in native UI where the platform has no translated text of its own, such as the suggested name of a save dialog or the error pages of a browser window. Every text defaults to English, and DesktopPlatformTexts.Current is the set every provider of the process uses.

Remarks

Take the texts from the application's own translations, for example its Runic Translations catalog, and set DesktopPlatformTexts.Current again after a language switch, as for DesktopHost.SetMenuBar. The optional Runic.Application.Views.Translations package has them in English and German and keeps them in the application's locale. Dialogs and pages that open later use the new texts; open ones keep theirs.

Where the platform has a translated default, Runic uses it and these texts do not apply: the buttons of file dialogs come from the portal backend, GTK or AppKit, a macOS panel shows no title, and GTK and AppKit draw their menus' shortcut labels themselves. The xdg-desktop-portal FileChooser and the GTK 3 dialog need a title, which is the request's Title or one of the dialog titles here.

A text has 1 to 1024 characters, no NUL and is not only white space; setting DesktopPlatformTexts.Current throws ArgumentException otherwise. The shortcut key names may be null.

Example

DesktopPlatformTexts.Current = new DesktopPlatformTexts
{
    UntitledFileName = "Unbenannt", ControlKeyName = "Strg", ShiftKeyName = "Umschalt", AltKeyName = "Alt",
};

Constructors

DesktopPlatformTexts

public DesktopPlatformTexts()

No documentation.

Properties

AccessDeniedTitle

public string AccessDeniedTitle { get; init; }

Gets the title of the page a Runic Desktop browser window shows when it may not connect; Access Denied. CS-WebUI windows show WebUI's own English page, which these texts do not reach.

AltKeyName

public string? AltKeyName { get; init; }

Gets the name of the Alt key in shortcut labels, as for DesktopPlatformTexts.ControlKeyName; else Alt.

ChooseApplicationTitle

public string ChooseApplicationTitle { get; init; }

Gets the title of the macOS panel that chooses the application to open a file with; Choose an application.

ConnectionErrorLabel

public string ConnectionErrorLabel { get; init; }

Gets the label before the message of a CS-WebUI page's connection banner, which WebUI's bridge shows; Error:.

ConnectionFailedMessage

public string ConnectionFailedMessage { get; init; }

Gets the banner of a CS-WebUI page that cannot connect to the application within five seconds; Failed to connect to the backend application.

ConnectionLostMessage

public string ConnectionLostMessage { get; init; }

Gets the banner of a CS-WebUI page whose connection to the application ended; Connection with the backend is lost. Runic's page script handles the connection itself, so its pages do not show it.

ContentInUseMessage

public string ContentInUseMessage { get; init; }

Gets the message of that page when another client already shows the window and multi-client mode is off; This content is already in use and multi-client mode is disabled.

ControlKeyName

public string? ControlKeyName { get; init; }

Gets the name of the Control key in shortcut labels that Runic writes itself: the Windows menu bar and context menus, and the in-page menu bar on Windows and Linux; Ctrl when it is null and another key name is set.

Remarks

All three names come from one source, so a label does not mix two languages. Once the application sets one of DesktopPlatformTexts.ControlKeyName, DesktopPlatformTexts.ShiftKeyName and DesktopPlatformTexts.AltKeyName, the labels use its names and English for the others. Without them, Runic Desktop's Windows windows take the names of the keyboard layout the user types with (Strg and Umschalt on a German layout) and lay their menu bars out again when the user switches layout; other hosts, such as the CS-WebUI in-page bar, and Linux show English names. Set the three names to match the application's language whatever the layout. Key names such as Del stay English.

Current

public static DesktopPlatformTexts Current { get; set; }

Gets or sets the texts that every provider of the process uses; the English defaults until the application sets others. Setting null returns to them.

Exceptions

ArgumentException

A text is empty, white space, longer than 1024 characters or contains NUL.

LaunchLinkInvalidMessage

public string LaunchLinkInvalidMessage { get; init; }

Gets the message of that page when a browser opens a launch link that is not valid or was already used.

LoadingTitle

public string LoadingTitle { get; init; }

Gets the title of a window until the page has a title: on Windows while WebView2 is still starting, where it is also the loading surface's accessible name, which a screen reader reads, and on Linux with GTK 4. Loading….

OpenDirectoriesTitle

public string OpenDirectoriesTitle { get; init; }

Gets the title of a Linux dialog that opens several directories; Open directories.

OpenDirectoryTitle

public string OpenDirectoryTitle { get; init; }

Gets the title of a Linux dialog that opens one directory; Open directory.

OpenFileTitle

public string OpenFileTitle { get; init; }

Gets the title of a Linux dialog that opens one file without a title of its own; Open file.

OpenFilesTitle

public string OpenFilesTitle { get; init; }

Gets the title of a Linux dialog that opens several files; Open files.

ResourceUnavailableMessage

public string ResourceUnavailableMessage { get; init; }

Gets the message of that page; The requested resource is not available.

ResourceUnavailableTitle

public string ResourceUnavailableTitle { get; init; }

Gets the title of the page for a resource a Runic Desktop browser window does not serve; Resource Not Available. A CS-WebUI window that serves an embedded frontend shows it too; WebUI's own page for a file missing from a web root folder stays English.

SaveFileTitle

public string SaveFileTitle { get; init; }

Gets the title of a Linux save dialog without a title of its own; Save file.

SecretCollectionLabel

public string SecretCollectionLabel { get; init; }

Gets the label of the Secret Service collection Runic creates on Linux when the user has no default keyring yet; Default keyring. The keyring manager shows it.

ServerErrorMessage

public string ServerErrorMessage { get; init; }

Gets the message of that page; The application could not answer this request.

ServerErrorTitle

public string ServerErrorTitle { get; init; }

Gets the title of the page a CS-WebUI window answers when the application fails to answer a request, for example with an exception in its file handler; Internal Server Error.

ShiftKeyName

public string? ShiftKeyName { get; init; }

Gets the name of the Shift key in shortcut labels, as for DesktopPlatformTexts.ControlKeyName; else Shift.

UntitledFileName

public string UntitledFileName { get; init; }

Gets the name a save dialog suggests when the request names no file; Untitled.

WebSocketUnsupportedMessage

public string WebSocketUnsupportedMessage { get; init; }

Gets the banner of a CS-WebUI page in a browser without WebSocket; WebSocket is not supported by your web browser.