Created with ❤ in Poland by lepo.co
Convenient app translation.
- Install Lepo.i18n library via NuGet.
- Add translation files to your application, e.g.
Strings/pl_PL.yaml
, and mark them as embedded resource.
<ItemGroup>
<EmbeddedResource Include="Strings\pl_PL.yaml" />
</ItemGroup>
- Add translations to these files
using direct phrases
Hello World: Witaj Świecie
or keys
main.view.wellcome: Hello World
- Register selected language
Lepo.i18n.Translator.SetLanguage(
Assembly.GetExecutingAssembly(),
"pl_PL",
"Lepo.i18n.Demo.Strings.pl_PL.yaml"
);
- Add a library reference in your XAML and start translating.
<Page xmlns:i18n="clr-namespace:Lepo.i18n;assembly=Lepo.i18n">
<!-- Via markup extension -->
<TextBlock Text="{i18n:Translate String='Hello World'}"/>
<!-- Or converter -->
<wpfui:CardExpander
Header="{i18n:Translate String='card.networks.title'}"
Subtitle="{Binding NetworksCount, ConverterParameter='card.networks.detected'
Converter={StaticResource TranslateConverter}, Mode=OneWay}"/>
</Page>
Use Visual Studio 2022 and invoke the .sln.
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.
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.