12345678910111213141516171819202122232425262728 |
- // <author></author>
- // <date></date>
- // <description></description>
- using Microsoft.AspNetCore.Builder;
- using Microsoft.AspNetCore.Localization;
- using System.Globalization;
- namespace ERP.Framework.Extensions
- {
- public static class I18NExtension
- {
- public static void UseI18N(this IApplicationBuilder app)
- {
- app.UseRequestLocalization(options =>
- {
- var supporttedCultures = new List<CultureInfo>
- {
- new CultureInfo("en-US"),
- new CultureInfo("zh-CN"),
- };
- options.DefaultRequestCulture = new RequestCulture("en-US");
- options.SupportedCultures = supporttedCultures;
- options.SupportedUICultures = supporttedCultures;
- });
- }
- }
- }
|