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

Adding All Cultures Support

parent 360e60c6
...@@ -34,13 +34,10 @@ namespace Stratis.Guru.Controllers ...@@ -34,13 +34,10 @@ namespace Stratis.Guru.Controllers
public IActionResult Index() public IActionResult Index()
{ {
var rqf = Request.HttpContext.Features.Get<IRequestCultureFeature>();
double displayPrice = 0; double displayPrice = 0;
double last24Change = 0; var rqf = Request.HttpContext.Features.Get<IRequestCultureFeature>();
dynamic coinmarketcap = JsonConvert.DeserializeObject(_memoryCache.Get("Coinmarketcap").ToString()); 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")) if (rqf.RequestCulture.UICulture.Name.Equals("en-US"))
{ {
......
...@@ -97,16 +97,7 @@ namespace Stratis.Guru ...@@ -97,16 +97,7 @@ namespace Stratis.Guru
DefaultFilesOptions = { DefaultFileNames = {"index.html"}} DefaultFilesOptions = { DefaultFileNames = {"index.html"}}
}); });
var supportedCultures = new[] var allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures).Where(x => !x.IsNeutralCulture).ToList();
{
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 defaultCulture = new RequestCulture("en-US"); var defaultCulture = new RequestCulture("en-US");
defaultCulture.UICulture.NumberFormat.CurrencySymbol = "$"; defaultCulture.UICulture.NumberFormat.CurrencySymbol = "$";
...@@ -114,8 +105,8 @@ namespace Stratis.Guru ...@@ -114,8 +105,8 @@ namespace Stratis.Guru
app.UseRequestLocalization(new RequestLocalizationOptions app.UseRequestLocalization(new RequestLocalizationOptions
{ {
DefaultRequestCulture = defaultCulture, DefaultRequestCulture = defaultCulture,
SupportedCultures = supportedCultures, SupportedCultures = allCultures,
SupportedUICultures = supportedCultures SupportedUICultures = allCultures
}); });
app.UseSignalR(routes => 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