Last active
January 28, 2019 15:08
-
-
Save devsuperman/5cdc05891e41f4c7bd10d4b57563d8ef to your computer and use it in GitHub Desktop.
Método de extensão de cultura brasileira
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Globalization; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Localization; | |
namespace Tambaqui.Extensions | |
{ | |
public static class AppExtensions | |
{ | |
public static IApplicationBuilder UsarCulturaBrasileira(this IApplicationBuilder app){ | |
var ptbr = "pt-BR"; | |
var supportedCultures = new[] { new CultureInfo(ptbr) }; | |
app.UseRequestLocalization(new RequestLocalizationOptions | |
{ | |
DefaultRequestCulture = new RequestCulture(culture: ptbr, uiCulture: ptbr), | |
SupportedCultures = supportedCultures, | |
SupportedUICultures = supportedCultures | |
}); | |
return app; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment