Cacx.LanguageManager.Abstractions 1.1.2

dotnet add package Cacx.LanguageManager.Abstractions --version 1.1.2
                    
NuGet\Install-Package Cacx.LanguageManager.Abstractions -Version 1.1.2
                    
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="Cacx.LanguageManager.Abstractions" Version="1.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cacx.LanguageManager.Abstractions" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Cacx.LanguageManager.Abstractions" />
                    
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 Cacx.LanguageManager.Abstractions --version 1.1.2
                    
#r "nuget: Cacx.LanguageManager.Abstractions, 1.1.2"
                    
#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 Cacx.LanguageManager.Abstractions@1.1.2
                    
#: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=Cacx.LanguageManager.Abstractions&version=1.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Cacx.LanguageManager.Abstractions&version=1.1.2
                    
Install as a Cake Tool

πŸ“– Resource Manager πŸ“–

This Manager was originally created to manage languages in my WPF applications. <br> It also works on other kind of resources tho.

πŸ“š Lets go through a step by step tutorial on how to setup and use this library.

πŸ“‹ Setup

Open the project terminal and type in dotnet add package Cacx.LanguageManager --version 1.1.1

πŸ’» Usage

Optional: <br>

Register the LocalizationService via DI <br> You can also implement your own LocalizationService and register it via the Interface

public App()
{
    AppHost = Host.CreateDefaultBuilder().ConfigureServices((context, services) =>
    {
         _ = services.AddSingleton<ILocalizationService, LocalizationService>((_) =>
         {
             return new LocalizationService(basePath: "Some path...");
         });
    }.Build();

    _ = AppHost.Services.GetRequiredService<ILocalizationService>(); //This call is needed! Just disregard the service
}

Step 1

➑️ Get the ILocalizationService implementation

There a two ways to achieve this. <br>

Either get it from your DI Container

public ExampleCtor(ILocalizationService service)
{
  
}

or instanciate an ILocalizationService one time...

//Call this at the start of your application
public void Method()
{
  _ = new LocalizationService("some random path...") //You dont have to use the instance instantly you can disregrad it for now
}

and use this property afterwards to get it...

public void SomeOtherMethod()
{
  ILocalizationService service = LocalizationProvider.Service;
}

Step 2

🌐 Set the Language

This will be CultureInfo.CurrentUICulture by default

public void Example()
{
  CultureInfo language = new CultureInfo("en-US");
  service.SetLanguage(language);
}

Step 3

πŸ”Update/Set the Context

Imagine you have this folder structure (which is recommended)

///   MyApp(Project)
///    ->Resources(Folder)
///        ->Login(Folder)
///            Login.resx
///            Login.de-DE.resx
///        ->CreateAccount(Folder)
///            CreateAccount.resx
///            CreateAccount.de-DE.resx

➑️ Imagine you wanna access the Login resource
public void Example()
{
  string basePath = "MyApp.Resources.Login.Login"; //"{ProjectName}.{Folder}.{Folder}.{Filename}"
  service.UpdateContext(basePath);
}

You have to do this context switch to access the resources of another file!

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.
  • net10.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Cacx.LanguageManager.Abstractions:

Package Downloads
Cacx.LanguageManager

A lightweight localization system for .NET and WPF.

Cacx.LanguageManager.Core

A lightweight localization system for .NET and WPF.

Cacx.LanguageManager.Wpf

A lightweight localization system for .NET and WPF.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.2 192 12/20/2025
1.1.1 238 12/7/2025
1.1.0 150 12/6/2025
1.0.0 230 12/3/2025