Runic.Translations.CommandLine 0.7.0-preview.4

This is a prerelease version of Runic.Translations.CommandLine.
dotnet add package Runic.Translations.CommandLine --version 0.7.0-preview.4
                    
NuGet\Install-Package Runic.Translations.CommandLine -Version 0.7.0-preview.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Runic.Translations.CommandLine" Version="0.7.0-preview.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Runic.Translations.CommandLine" Version="0.7.0-preview.4" />
                    
Directory.Packages.props
<PackageReference Include="Runic.Translations.CommandLine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Runic.Translations.CommandLine --version 0.7.0-preview.4
                    
#r "nuget: Runic.Translations.CommandLine, 0.7.0-preview.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Runic.Translations.CommandLine@0.7.0-preview.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Runic.Translations.CommandLine&version=0.7.0-preview.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Runic.Translations.CommandLine&version=0.7.0-preview.4&prerelease
                    
Install as a Cake Tool

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:

  1. Your catalog, which can translate your DescriptionKey values and override any framework text.
  2. 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.
  3. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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