Runic.Translations.CommandLine 0.13.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Runic.Translations.CommandLine --version 0.13.0
                    
NuGet\Install-Package Runic.Translations.CommandLine -Version 0.13.0
                    
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.13.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Runic.Translations.CommandLine" Version="0.13.0" />
                    
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.13.0
                    
#r "nuget: Runic.Translations.CommandLine, 0.13.0"
                    
#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.13.0
                    
#: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.13.0
                    
Install as a Cake Addin
#tool nuget:?package=Runic.Translations.CommandLine&version=0.13.0
                    
Install as a Cake Tool

Runic.Translations.CommandLine

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;

TranslationContext translations = await TranslationContext.CreateBuilder()
    .AddCatalog(AppTextCatalog.Registration)
    .AddCatalog(TranslationCommandTextResolver.CatalogRegistration)
    .BuildAsync("de");
return await new CommandApp(GeneratedCommandCatalog.Create())
{
    Culture = CultureInfo.GetCultureInfo("de"),
    TextResolver = new TranslationCommandTextResolver(translations, AppTextCatalog.CatalogId),
}.RunAsync(args);

Versions

The adapter carries the Runic Translations version and supports exactly one Runic.CommandLine minor (lockstep): its package depends on Runic.CommandLine [0.y.0, 0.(y+1).0-0.0) and on Runic.Translations and Runic.Translations.Hosting of its own minor. Every Runic.CommandLine minor is followed in the same release train by a Translations release whose adapter covers every key of it, and patches add no keys. Use the pair from one row:

Runic.Translations.CommandLine Runic.CommandLine
0.13.x 0.13.x
0.12.x 0.13.x
0.11.x 0.13.x
0.10.x 0.12.x
0.9.x 0.9.x

Runic.CommandLine 0.10 and 0.11 have no adapter release; use Runic.CommandLine 0.12 or later with the matching adapter row. Another combination is NuGet warning NU1608 at restore and can show English framework lines. The text itself comes from the Runic.CommandLine package: it carries the runic-command-line catalog sources under translations/ (runic.json, en.rmf2, de.rmf2 and the key list text-keys.json), and this package compiles exactly the text of the Command Line release it is built against, so a key and its German cannot drift apart.

Framework text and your text

Framework text comes from the runic-command-line catalog (English and German). Your catalog overlays it: it translates your DescriptionKey values and can override any framework text. Precedence is locale-first: for each locale of the requested locale's fallback chain, your message is tried before the built-in one, and only then the next locale, so the built-in German beats an override your catalog has only in English. A key that neither has returns null, so Runic.CommandLine writes its English text.

Lead with a context, as above: the resolver follows the context's locale, and the context's overlays apply to the framework text, including the build-time overrides of your runic.json (translations/overrides/runic-command-line/<locale>.rmf2, added with .AddOverlays(AppTextCatalog.Overlays)). The constructors over an ITranslationSnapshot or ITranslationManager use the built-in framework text without the context's overlays, so a build-time override of runic-command-line is ignored there. To resolve in the invocation culture (CommandApp.Culture) itself, pass a TranslationContextBuilder; the resolver builds one context per culture. When the context's locale names another language than the culture, the text keeps that locale and the resolver reports it once: a warning: line on standard error, so a shipped console app shows it, and a trace warning. It reports the same way, once, when your text has a locale that runic-command-line lacks; an override file for that locale adds it.

With Runic.Translations.Hosting, services.AddRunicCommandLineTranslations(AppTextCatalog.CatalogId) adds the catalog to the shared context and registers an ICommandTextResolver over it; give that resolver to CommandApp.TextResolver.

For other languages, register TranslationCommandTextResolver.CatalogRegistration in the builder and attach a TranslationOverlay for TranslationCommandTextResolver.CatalogId, such as French packs:

TranslationContextBuilder catalogs = TranslationContext.CreateBuilder()
    .AddCatalog(AppTextCatalog.Registration)
    .AddCatalog(TranslationCommandTextResolver.CatalogRegistration)
    .AddOverlay(TranslationOverlay.FromPacks(TranslationCommandTextResolver.CatalogId, packs, [new TranslationOverlayLocale("fr")]));
var resolver = new TranslationCommandTextResolver(catalogs, AppTextCatalog.CatalogId);

Framework text lists every framework catalog, how to register and override it, and the German style guide.

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.14.0 0 11/18/2026
0.13.0 295 11/16/2026
0.12.0 184 11/15/2026
0.11.0 304 11/14/2026
0.10.0 115 11/13/2026
0.9.1 158 11/9/2026
0.8.0 1,387 10/22/2026
0.7.0-preview.4 309 10/17/2026
0.7.0-preview.3 153 10/17/2026
0.7.0-preview.2 150 10/15/2026
0.7.0-preview.1 122 10/14/2026
0.6.0-preview.7 70 10/12/2026