Skip to content

Usage Examples

var localizer = services.GetRequiredService<MyViewModelLocalized>();
// Simple string property
Console.WriteLine(localizer.Welcome);
// Format string method
Console.WriteLine(localizer.UserGreetingFormat("Allan", "MyApp"));
// Output: Hello Allan, welcome to MyApp!
<Label Text="{Binding Localizer.Welcome}" />
@inject MyViewModelLocalized Localizer
<h1>@Localizer.Welcome</h1>
<p>@Localizer.UserGreetingFormat(User.Name, "MyApp")</p>

The generated class exposes the underlying IStringLocalizer for edge cases:

// Dynamic key lookup when you need it
var value = localizer.Localizer["SomeDynamicKey"];

Generate classes with internal instead of public access:

<PropertyGroup>
<GenerateLocalizersInternal>True</GenerateLocalizersInternal>
</PropertyGroup>
claude plugin marketplace add shinyorg/skills
claude plugin install shiny-extensions@shiny

Coming soon — Copilot plugin install instructions will be added here.

View shiny-extensions Plugin