Created with ❤ in Poland by lepo.co
Lepo.i18n is an essential tool for developers aiming to create multilingual applications in WPF, WinForms, or CLI environments. By harnessing the capabilities of Dependency Injection (DI) and localization resources, Lepo.i18n facilitates better management of language resources, reducing complexity and enhancing the adaptability of your applications to different languages and cultures. With its support for JSON, WPF, and YAML formats, Lepo.i18n ensures seamless integration of localization into your project, making it a go-to solution for your internationalization needs.
This repository contains the source code for the Lepo.i18n NuGet packages.
Lepo.i18n is available as NuGet package on NuGet.org:
https://www.nuget.org/packages/Lepo.i18n
https://www.nuget.org/packages/Lepo.i18n.DependencyInjection
https://www.nuget.org/packages/Lepo.i18n.Wpf
https://www.nuget.org/packages/Lepo.i18n.Json
You can add it to your project using .NET CLI:
dotnet add package Lepo.i18n.Wpf
dotnet add package Lepo.i18n.DependencyInjection
, or package manager console:
NuGet\Install-Package Lepo.i18n.Wpf
NuGet\Install-Package Lepo.i18n.DependencyInjection
In this step, we register our localizations in the DI container.
IHost host = Host.CreateDefaultBuilder()
.ConfigureServices((context, services) =>
{
services.AddStringLocalizer(b =>
{
b.FromResource<Translations>(new("pl-PL"));
b.FromYaml(assembly, "Lepo.i18n.Resources.Translations-en.yaml", new("en-US"));
});
}
)
.Build();
<Grid>
<CheckBox
Grid.Row="1"
Content="{i18n:StringLocalizer 'Leave the keys that were pressed marked.'}"
IsChecked="{Binding ViewModel.PreviewKeys, Mode=TwoWay}" />
</Grid>
To build the project, use Visual Studio 2022 and open the .sln file.
Visual Studio
Lepo.i18n is an Open Source project. You are entitled to download and use the freely available Visual Studio Community Edition to build, run or develop for Lepo.i18n. As per the Visual Studio Community Edition license, this applies regardless of whether you are an individual or a corporate user.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
Lepo.i18n is free and open source software licensed under MIT License. You can use it in private and commercial projects.
Keep in mind that you must include a copy of the license in your project.