在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):LazZiya/ExpressLocalization开源软件地址(OpenSource Url):https://github.com/LazZiya/ExpressLocalization开源编程语言(OpenSource Language):C# 100.0%开源软件介绍(OpenSource Introduction):
What is ExpressLocalization?A nuget package to simplify the localization setup of any Asp.Net Core web application. How to useInstall from nuget :
Add ExpressLocalization to using LazZiya.ExpressLocalization;
public void ConfigureServices(IServiceCollection services)
{
var cultures = new CultureInfo[]
{
new CultureInfo("en"),
new CultureInfo("tr"),
new CultureInfo("ar")
};
services.AddRazorPages()
.AddExpressLocalization<LocalizationResource>(
ops =>
{
ops.ResourcesPath = "LocalizationResources";
ops.RequestLocalizationOptions = o =>
{
o.SupportedCultures = cultures;
o.SupportedUICultures = cultures;
o.DefaultRequestCulture = new RequestCulture("en");
};
});
} Then configure the app to use public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// Other codes...
// Add localization middleware to the app
app.UseRequestLocalization();
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
});
} Setup and optionsFor all details goto wiki pages Step by step tutorialSample projectsLicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论