Runic.Translations.CommandLine
0.7.0-preview.4
dotnet add package Runic.Translations.CommandLine --version 0.7.0-preview.4
NuGet\Install-Package Runic.Translations.CommandLine -Version 0.7.0-preview.4
<PackageReference Include="Runic.Translations.CommandLine" Version="0.7.0-preview.4" />
<PackageVersion Include="Runic.Translations.CommandLine" Version="0.7.0-preview.4" />
<PackageReference Include="Runic.Translations.CommandLine" />
paket add Runic.Translations.CommandLine --version 0.7.0-preview.4
#r "nuget: Runic.Translations.CommandLine, 0.7.0-preview.4"
#:package Runic.Translations.CommandLine@0.7.0-preview.4
#addin nuget:?package=Runic.Translations.CommandLine&version=0.7.0-preview.4&prerelease
#tool nuget:?package=Runic.Translations.CommandLine&version=0.7.0-preview.4&prerelease
Runic.Translations.CommandLine (preview)
Runic.Translations.CommandLine translates the help, errors, prompts and
faults of a Runic.CommandLine
app with Runic Translations. It ships English and German text for every
framework key, so a German invocation shows no English framework text and you
write no key mapping.
using System.Globalization;
using Runic.CommandLine;
using Runic.CommandLine.Generated;
using Runic.Translations;
using Runic.Translations.CommandLine;
ITranslationSnapshot snapshot = await AppTextCatalog.CreateProvider().GetSnapshotAsync("de");
return await new CommandApp(GeneratedCommandCatalog.Create())
{
Culture = CultureInfo.GetCultureInfo("de"),
TextResolver = new TranslationCommandTextResolver(snapshot),
}.RunAsync(args);
TranslationCommandTextResolver resolves each key in this order:
- Your catalog, which can translate your
DescriptionKeyvalues and override any framework text. - The built-in English and German framework text, in the locale of your snapshot (or of the invocation culture for the parameterless constructor). Other locales use English.
null, so Runic.CommandLine writes its English text.
Pass an ITranslationManager instead of a snapshot to follow locale switches.
Message names
A text key becomes a message name by removing each hyphen and capitalizing the
letter after it: help.show-help is help.showHelp, diagnostics.unknown-option
is diagnostics.unknownOption and faults.RCLI4000 is unchanged.
TranslationCommandTextResolver.GetMessageName applies the rule. Name each
input after the framework argument, or after its position:
commands {
greet = Grüßt eine Person
}
diagnostics {
unknownOption =
.input {$option :string}
{{Unbekannte Option {$option}.}}
}
The Runic.CommandLine README links the framework text key
table, which lists every key and its argument names. A message may use only some of the
arguments; {$arg0}, {$arg1} and so on name them by position, which also
covers diagnostics your app creates. A message is skipped, and the next source
of text is used, when it declares an input the framework does not supply or
cannot be formatted. Inputs are :string, or :integer and :number for
arguments that are invariant numbers.
Name lookup uses ITranslationSnapshot.TryGetKey and TryGetPlaceholders,
which compiled snapshots implement. The adapter is trimming- and
NativeAOT-compatible.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Runic.CommandLine (>= 0.7.0-preview.1)
- Runic.Translations (>= 0.7.0-preview.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.0-preview.4 | 92 | 10/17/2026 |
| 0.7.0-preview.3 | 134 | 10/17/2026 |
| 0.7.0-preview.2 | 136 | 10/15/2026 |
| 0.7.0-preview.1 | 104 | 10/14/2026 |
| 0.6.0-preview.7 | 52 | 10/12/2026 |