File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/DotNetCore.CAP.Dashboard Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 22// Licensed under the MIT License. See License.txt in the project root for license information.
33
44using System ;
5- using System . Linq ;
5+ using System . Globalization ;
66using System . Net ;
77using System . Threading . Tasks ;
88using DotNetCore . CAP . Dashboard ;
99using DotNetCore . CAP . Dashboard . GatewayProxy ;
1010using DotNetCore . CAP . Dashboard . NodeDiscovery ;
11+ using DotNetCore . CAP . Dashboard . Resources ;
1112using DotNetCore . CAP . Persistence ;
1213using Microsoft . AspNetCore . Builder ;
1314using Microsoft . AspNetCore . Hosting ;
@@ -36,7 +37,6 @@ public static IApplicationBuilder UseCapDashboard(this IApplicationBuilder app)
3637 {
3738 app . UseMiddleware < GatewayProxyMiddleware > ( ) ;
3839 }
39-
4040 app . UseMiddleware < DashboardMiddleware > ( ) ;
4141 }
4242
@@ -77,7 +77,7 @@ public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next)
7777 app . UseCapDashboard ( ) ;
7878
7979 next ( app ) ;
80- } ;
80+ } ;
8181 }
8282 }
8383
@@ -106,6 +106,9 @@ public async Task Invoke(HttpContext context)
106106 return ;
107107 }
108108
109+ var userLanguages = context . Request . Headers [ "Accept-Language" ] . ToString ( ) ;
110+ Strings . Culture = userLanguages . Contains ( "zh-" ) ? new CultureInfo ( "zh-CN" ) : new CultureInfo ( "en-US" ) ;
111+
109112 // Update the path
110113 var path = context . Request . Path ;
111114 var pathBase = context . Request . PathBase ;
You can’t perform that action at this time.
0 commit comments