A cross-platform .NET implementation of the GNU Gettext library, initially forked from NGettext.
GetText.NET supports string interpolation and FormattableString.
GetText.NET.Extractor extracts string values from C# source code in GetText.ICatalog method calls to Get*String(), and also supports localizing Windows.Forms.Control and WPF element properties showing text, such as .Text, .HeaderText, .ToolTip or .Content.
GetText.NET has simplified usage over NGetText and original GNU Gettext tools, i.e. removed Get*StringFmt() methods and pass parameters directly to Get*String() overloads, and also removed the need for LC_MESSAGES subfolder to place translation files.
This fully managed library targets Microsoft .NET Standard 2.0 to support a wide range of .NET implementations including .NET Framework >=4.6.1, .NET Core >=2.0, Mono and more. It is fully COM and CLS compatible.
The 11.x development line keeps the core library on .NET Standard 2.0. The extractor tool requires .NET 10; Windows Forms and WPF integration target .NET Framework 4.6.1 and .NET 10 for Windows. See the release notes for upcoming changes and version-specific history.
Translations are loaded directly from gettext *.mo files. Multiple translation domains and multiple locales can be loaded in one application instance. There is no need to compile satellite assemblies. GetText.NET supports both little-endian and big-endian MO files, automatic (header-based) encoding detection and (optional) plural form rules parsing.
The repository includes its Wiki as a Git submodule. To clone the source together with the Wiki, use:
git clone --recurse-submodules https://github.com/perpetualKid/GetText.NET.git
If you have already cloned the repository without --recurse-submodules, initialize the Wiki with:
git submodule update --init --recursive
For details on each product, examples and FAQ please check the Wiki pages.
- WPF localization and language switching, including text ownership, bindings and access keys.
- Extractor installation and command-line options.
- Runnable samples:
samples\Wpf\Samples.Hello.Wpfandsamples\WinForms\Samples.Hello.WinForms, with catalogs insamples\Shared\Locales.
Please check Releases Notes for version history
| Package | Status |
|---|---|
| GetText.NET | |
| GetText.NET.PluralCompile | |
| GetText.NET.WindowsForms | |
| GetText.NET.Wpf | |
| GetText.NET.Extractor |
For further details on each product, also check the Wiki pages.