LaunchBoxContributors
On this page

PluginText14.1

Class in Unbroken.LaunchBox.Plugins.Models.Localization

C#
public sealed class PluginText
Describes plugin-supplied text that LaunchBox can localize and format for the current user.

Remarks

The fallback format is always available. When a resource key is supplied, LaunchBox resolves it from the plugin package's resources/strings/{culture}.json tables, selects the user's language, and inserts the format arguments using the user's culture. A missing or malformed localized format falls back to the supplied format.

Constructors

  • PluginTextInitializes text with a required fallback format and optional format arguments.

PluginText

C#
public PluginText(string fallbackFormat, params object?[] formatArguments)
Initializes text with a required fallback format and optional format arguments.
fallbackFormat
The fallback text or composite format string.
formatArguments
The values inserted into the selected format using the user's culture.

Properties

  • FallbackFormatGets the required fallback format used when no localized resource is available or no resource key is supplied.
  • FormatArgumentsGets the values inserted into the selected format using the user's culture.
  • ResourceKeyGets the optional key resolved from the plugin package's localized string resources.

FallbackFormat

C#
public string FallbackFormat { get; }
Gets the required fallback format used when no localized resource is available or no resource key is supplied.

FormatArguments

C#
public IReadOnlyList<object?> FormatArguments { get; }
Gets the values inserted into the selected format using the user's culture.

ResourceKey

C#
public string? ResourceKey { get; init; }
Gets the optional key resolved from the plugin package's localized string resources.

Operators

  • op_ImplicitConverts a string to literal fallback text without a resource key or format arguments.

op_Implicit

C#
public static implicit operator PluginText(string fallbackText)
Converts a string to literal fallback text without a resource key or format arguments.
fallbackText
The nonblank literal fallback text.

Returns

The plugin text containing the supplied fallback.
Exception: ArgumentException
The fallback text is null, empty, or whitespace.