Commit cbd53ee8 authored by Clint.Network's avatar Clint.Network

Adding All Cultures Support

parent 360e60c6
......@@ -34,13 +34,10 @@ namespace Stratis.Guru.Controllers
public IActionResult Index()
{
var rqf = Request.HttpContext.Features.Get<IRequestCultureFeature>();
double displayPrice = 0;
double last24Change = 0;
var rqf = Request.HttpContext.Features.Get<IRequestCultureFeature>();
dynamic coinmarketcap = JsonConvert.DeserializeObject(_memoryCache.Get("Coinmarketcap").ToString());
last24Change = coinmarketcap.data.quotes.USD.percent_change_24h / 100;
var last24Change = coinmarketcap.data.quotes.USD.percent_change_24h / 100;
if (rqf.RequestCulture.UICulture.Name.Equals("en-US"))
{
......
......@@ -97,16 +97,7 @@ namespace Stratis.Guru
DefaultFilesOptions = { DefaultFileNames = {"index.html"}}
});
var supportedCultures = new[]
{
new CultureInfo("en-US"),
new CultureInfo("en-GB"),
new CultureInfo("fr-FR"),
new CultureInfo("ru-RU"),
new CultureInfo("it-IT"),
new CultureInfo("de-DE"),
new CultureInfo("cn-CN")
};
var allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures).Where(x => !x.IsNeutralCulture).ToList();
var defaultCulture = new RequestCulture("en-US");
defaultCulture.UICulture.NumberFormat.CurrencySymbol = "$";
......@@ -114,8 +105,8 @@ namespace Stratis.Guru
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = defaultCulture,
SupportedCultures = supportedCultures,
SupportedUICultures = supportedCultures
SupportedCultures = allCultures,
SupportedUICultures = allCultures
});
app.UseSignalR(routes =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment