https://github.com/lazziya/expresslocalization
All dirty localization settings in simple steps
https://github.com/lazziya/expresslocalization
asp-net-core express-localization globalization localization nuget
Last synced: 13 days ago
JSON representation
All dirty localization settings in simple steps
- Host: GitHub
- URL: https://github.com/lazziya/expresslocalization
- Owner: LazZiya
- License: mit
- Created: 2019-05-12T16:32:19.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T06:27:27.000Z (7 months ago)
- Last Synced: 2025-03-31T11:02:33.802Z (23 days ago)
- Topics: asp-net-core, express-localization, globalization, localization, nuget
- Language: C#
- Homepage: https://docs.ziyad.info
- Size: 1.21 MB
- Stars: 39
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
##
> ### ATTENTION: Due to several major breaking changes in the planned v5, the next version has been moved to a new project! ExpressLocalization will continue to get support and hotfixes. To continue with the next vesion please see:
> ### New project repository: [XLocalizer](https://github.com/LazZiya/XLocalizer)
> ### New project docs: [DOCS.Ziyad.info](http://docs.ziyad.info/)
> ### Sample repository: [XLocalizer.Samples](https://github.com/LazZiya/XLocalizer.Samples)##
## What is ExpressLocalization?
A nuget package to simplify the localization setup of any Asp.Net Core web application.### How to use
Install from nuget :
````
Install-Package LazZiya.ExpressLocalization
````Add _ExpressLocalization_ to `startup.cs`:
````cs
using LazZiya.ExpressLocalization;public void ConfigureServices(IServiceCollection services)
{
var cultures = new CultureInfo[]
{
new CultureInfo("en"),
new CultureInfo("tr"),
new CultureInfo("ar")
};services.AddRazorPages()
.AddExpressLocalization(
ops =>
{
ops.ResourcesPath = "LocalizationResources";
ops.RequestLocalizationOptions = o =>
{
o.SupportedCultures = cultures;
o.SupportedUICultures = cultures;
o.DefaultRequestCulture = new RequestCulture("en");
};
});
}
````Then configure the app to use `RequestLocalization` middleware :
````cs
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// Other codes...
// Add localization middleware to the app
app.UseRequestLocalization();app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
});
}
````### Setup and options
For all details goto [wiki pages](https://github.com/LazZiya/ExpressLocalization/wiki)### Step by step tutorial
* [Develop Multi Cultural Web Application Using ExpressLocalization](https://www.codeproject.com/Articles/5061604/Developing-Multicultural-ASP-NET-Core-3-2-1-Projec)### Sample projects
* [Asp.Net Core 2.2](https://github.com/LazZiya/ExpressLocalizationSample)
* [Asp.Net Core 3.0](https://github.com/LazZiya/ExpressLocalizationSampleCore3)### License
MIT