Skip to content

Instantly share code, notes, and snippets.

@devsuperman
Last active January 28, 2019 15:08
Show Gist options
  • Save devsuperman/5cdc05891e41f4c7bd10d4b57563d8ef to your computer and use it in GitHub Desktop.
Save devsuperman/5cdc05891e41f4c7bd10d4b57563d8ef to your computer and use it in GitHub Desktop.
Método de extensão de cultura brasileira
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