Metaphrase 1.0.0-beta.37
dotnet add package Metaphrase --version 1.0.0-beta.37
NuGet\Install-Package Metaphrase -Version 1.0.0-beta.37
<PackageReference Include="Metaphrase" Version="1.0.0-beta.37" />
<PackageVersion Include="Metaphrase" Version="1.0.0-beta.37" />
<PackageReference Include="Metaphrase" />
paket add Metaphrase --version 1.0.0-beta.37
#r "nuget: Metaphrase, 1.0.0-beta.37"
#:package Metaphrase@1.0.0-beta.37
#addin nuget:?package=Metaphrase&version=1.0.0-beta.37&prerelease
#tool nuget:?package=Metaphrase&version=1.0.0-beta.37&prerelease
Metaphrase
A C# port of the ngx-translate. The port is not one to one and also aims to be more C# friendly where possible.
The library provides you with a TranslateService which combined with a TranslateLoader (HttpLoader built in) enables you to load, compile and display your translations. You format the strings keys. For a much stronger formatting a package that uses the awesome SmartFormat project is provided.
Packages
| Package | Stable | Pre |
|---|---|---|
| Metaphrase | ||
| Metaphrase.SmartFormat |
Usage
Description
- Metaphrase
- Contains the
abstractions,defaults,primitives,http loaderand theservice.
- Contains the
- Metaphrase.SmartFormat
- Contains the
SmartFormatParser.
- Contains the
Installation:
Metaphrasein projects that you want to use the service or any of the primitives.Metaphrase.SmartFormatin projects that use the service and you want to replace the default parser.
Getting Started
The section will describe how to get started with Translate in a Blazor Wasm using the HttpLoader storing the language files at wwwroot/i18n.
- Add the
Metaphrasepackage.
dotnet add package Metaphrase
- Add the appropriate services to the service provider.
services.AddScoped(sp => new HttpClient() { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
services.AddScoped<TranslateLoader, TranslateHttpLoader>(); // This will use the default options
services.AddScoped<TranslateService>(); // This will use the default parser
- Use the service
TranslateService also supports a "pipe" syntax to get your translation values.
For the tanslation key: hello and value: Hello you can do:
translate.Instant("hello") // prints "Hello"
translate | "hello" // prints "Hello"
For the translation key: welcome, value: Welcome {user}! and param: user.
translate.Instant("hello", new { user = "panos" }) // prints "Welcome panos"!
translate | "hello" | new { user = "panos" } // prints "Welcome panos"!
Contributing
For general contribution information you can read the Raven Tail Contributing document.
Local Development
To develop you need:
- dotnet 9.0 SDK
- Visual Studio or VS Code with the C# extension.
- Configured your IDE for the TUnit library.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Metaphrase:
| Package | Downloads |
|---|---|
|
Metaphrase.SmartFormat
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-beta.37 | 42 | 2/24/2026 |
| 1.0.0-beta.11 | 52 | 2/6/2026 |
| 1.0.0-beta.8 | 49 | 2/3/2026 |