XLocalizer 1.0.3
See the version list below for details.
dotnet add package XLocalizer --version 1.0.3
NuGet\Install-Package XLocalizer -Version 1.0.3
<PackageReference Include="XLocalizer" Version="1.0.3" />
<PackageVersion Include="XLocalizer" Version="1.0.3" />
<PackageReference Include="XLocalizer" />
paket add XLocalizer --version 1.0.3
#r "nuget: XLocalizer, 1.0.3"
#:package XLocalizer@1.0.3
#addin nuget:?package=XLocalizer&version=1.0.3
#tool nuget:?package=XLocalizer&version=1.0.3
XLocalizer for Asp.Net Core
Read full docs at: docs.ziya.info.tr
Goodbye "manually creating localization resources", welcome XLocalizer...!
What is XLocalizer
This is a nuget package that offers localization for Asp.Net Core based on .resx, .xml, db or any other custom file/db type. Powered by online translation and auto resource creating. XLocalizer has many powerful features and can be extended with custom tools.
- Online Translation: Auto translation of missed localized values.
- Auto Key Adding: Auto adding missing keys to the resources files.
- Multiple Resource Type Support: Built-in localization support based on .RESX, .XML, DB. Extendable localization support based on any custom file/db type.
- Export to Resx: Resources from any source type can be exported to .RESX files via built-in exporters.
- Do it Fast: Custom cache support for speeding up the process of getting localized values from sources.
- Standard interfaces: Easy to use due to using the standard localization interfaces:
IStringLocalizer,IHtmlLocalizer,IStringLocalizerFactoryandIHtmlLocalizerFactory.
How it Works
XLocalizer will translate and save localized keys into automatically created resource files. Since XLocalizer modules are implementing the default localization interfaces (IStringLocalizer, etc.) so any text passed into the localization services will be translated automatically and added into the relevant resource file/db.
Additionally, XLocalizer has built-in modules to localize all system error messages like (DataAnnotations, ModelBinding and Identity errors) without any additional workload.
Quick Setup
services.AddRazorPages()
.AddXLocalizer<LocSource, GoogleTranslateService>(ops =>
{
ops.ResourcesPath = "LocalizationResources";
ops.AutoTranslate = true;
ops.AutoAddKeys = true;
ops.UseExpressMemoryCache = true;
ops.TranslateFromCulture = "en";
});
For more details see setup instructions based on project type:
- MVC/Razor Pages and XML Resource
- MVC/Razor Pages and DB Resource
- MVC/Razor Pages and RESX Resource
- Blazor and XML Resource
See also:
Disclaimer Third Parties
All product and company names of translation services are trademarks� or registered� trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
During the development of XLocalizer I've used many online translation services with the freemium plan, but it is up to you to use a priced plan from the respective service.
Each translation service has its pros and cons. MyMemory Translate provided the best results for the languages I've been working with (in terms performans and amount of free translation requests). So, in this documentation you will see most samples refering to MyMemory Translate as the translation service. But you are free to use any other service that fits your needs.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 is compatible. netcoreapp2.2 is compatible. netcoreapp3.0 is compatible. netcoreapp3.1 is compatible. |
-
.NETCoreApp 2.0
- Microsoft.AspNetCore.Identity (>= 2.0.4)
- Microsoft.AspNetCore.Mvc.Localization (>= 2.0.0)
- Microsoft.AspNetCore.Mvc.RazorPages (>= 2.0.0)
- XLocalizer.Translate (>= 1.0.0)
-
.NETCoreApp 2.1
- Microsoft.AspNetCore.Identity (>= 2.1.0)
- Microsoft.AspNetCore.Mvc.Localization (>= 2.1.0)
- Microsoft.AspNetCore.Mvc.RazorPages (>= 2.1.0)
- XLocalizer.Translate (>= 1.0.0)
-
.NETCoreApp 2.2
- Microsoft.AspNetCore.Identity (>= 2.2.0)
- Microsoft.AspNetCore.Mvc.Localization (>= 2.2.0)
- Microsoft.AspNetCore.Mvc.RazorPages (>= 2.2.0)
- Microsoft.AspNetCore.Routing (>= 2.2.0)
- XLocalizer.Translate (>= 1.0.0)
-
.NETCoreApp 3.0
- XLocalizer.Translate (>= 1.0.0)
-
.NETCoreApp 3.1
- XLocalizer.Translate (>= 1.0.0)
-
net5.0
- XLocalizer.Translate (>= 1.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on XLocalizer:
| Package | Downloads |
|---|---|
|
XLocalizer.DB
Database provider for XLocalizer. |
|
|
XLocalizer.TagHelpers
LocalizeTagHelper for XLocalizer. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0-preview-1 | 631 | 3/26/2025 |
| 1.0.3 | 44,920 | 4/15/2021 |
| 1.0.2 | 1,610 | 1/6/2021 |
| 1.0.1 | 706 | 1/1/2021 |
| 1.0.0 | 6,081 | 11/12/2020 |
| 1.0.0-rc.1 | 406 | 11/5/2020 |
| 1.0.0-preview3 | 893 | 8/24/2020 |
| 1.0.0-preview2 | 858 | 7/27/2020 |
| 1.0.0-preview1 | 816 | 7/26/2020 |
Improvements
- Removed deprected property UseExpressValidationAttributes. See https://docs.ziyad.info/en/XLocalizer/v1.0/localizing-validation-attributes-errors.md
- New option LocalizeDefatulCultre: Use to enable/disable localizing default culture
See all docs: https://docs.ziyad.info/en/XLocalizer/v1.0/index.md
Release notes: https://github.com/LazZiya/XLocalizer/releases