Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
guru
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
guru
Commits
cbd53ee8
Commit
cbd53ee8
authored
Nov 08, 2018
by
Clint.Network
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding All Cultures Support
parent
360e60c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
17 deletions
+5
-17
HomeController.cs
Stratis.Guru/Controllers/HomeController.cs
+2
-5
Startup.cs
Stratis.Guru/Startup.cs
+3
-12
No files found.
Stratis.Guru/Controllers/HomeController.cs
View file @
cbd53ee8
...
@@ -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"
))
{
{
...
...
Stratis.Guru/Startup.cs
View file @
cbd53ee8
...
@@ -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
=
supported
Cultures
,
SupportedCultures
=
all
Cultures
,
SupportedUICultures
=
supported
Cultures
SupportedUICultures
=
all
Cultures
});
});
app
.
UseSignalR
(
routes
=>
app
.
UseSignalR
(
routes
=>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment