lepoco / i18n

Convenient localization of Windows applications with YAML files.

Home Page:https://lepo.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lepo.i18n

Created with ❤ in Poland by lepo.co
Convenient app translation.

GitHub license Nuget Nuget (with prereleases) Nuget Size Sponsors

Preview image

How to use?

  • 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>

Compilation

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.

License

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.

About

Convenient localization of Windows applications with YAML files.

https://lepo.co

License:MIT License


Languages

Language:C# 100.0%