File tree Expand file tree Collapse file tree 9 files changed +42
-1
lines changed
Components/test/testassets/TestServer Expand file tree Collapse file tree 9 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Globalization ;
2
3
using Microsoft . AspNetCore . Authentication . Cookies ;
3
4
using Microsoft . AspNetCore . Builder ;
4
5
using Microsoft . AspNetCore . Hosting ;
@@ -39,6 +40,10 @@ public void ConfigureServices(IServiceCollection services)
39
40
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
40
41
public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
41
42
{
43
+ var enUs = new CultureInfo ( "en-US" ) ;
44
+ CultureInfo . DefaultThreadCurrentCulture = enUs ;
45
+ CultureInfo . DefaultThreadCurrentUICulture = enUs ;
46
+
42
47
if ( env . IsDevelopment ( ) )
43
48
{
44
49
app . UseDeveloperExceptionPage ( ) ;
Original file line number Diff line number Diff line change 2
2
3
3
<PropertyGroup >
4
4
<TargetFramework >$(DefaultNetCoreTargetFramework)</TargetFramework >
5
+
6
+ <!-- Project supports more than one language -->
7
+ <BlazorWebAssemblyLoadAllGlobalizationData >true</BlazorWebAssemblyLoadAllGlobalizationData >
5
8
</PropertyGroup >
6
9
7
- <ItemGroup >
10
+ <ItemGroup >
8
11
<Reference Include =" Microsoft.AspNetCore" />
9
12
<Reference Include =" Microsoft.AspNetCore.Authentication.Cookies" />
10
13
<Reference Include =" Microsoft.AspNetCore.Components.WebAssembly.Server" />
Original file line number Diff line number Diff line change
1
+ using System . Globalization ;
1
2
using Microsoft . AspNetCore . Builder ;
2
3
using Microsoft . AspNetCore . Hosting ;
3
4
using Microsoft . Extensions . Configuration ;
@@ -38,6 +39,10 @@ public void ConfigureServices(IServiceCollection services)
38
39
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
39
40
public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
40
41
{
42
+ var enUs = new CultureInfo ( "en-US" ) ;
43
+ CultureInfo . DefaultThreadCurrentCulture = enUs ;
44
+ CultureInfo . DefaultThreadCurrentUICulture = enUs ;
45
+
41
46
if ( env . IsDevelopment ( ) )
42
47
{
43
48
app . UseDeveloperExceptionPage ( ) ;
Original file line number Diff line number Diff line change
1
+ using System . Globalization ;
1
2
using Microsoft . AspNetCore . Authentication . Cookies ;
2
3
using Microsoft . AspNetCore . Builder ;
3
4
using Microsoft . AspNetCore . Hosting ;
@@ -27,6 +28,10 @@ public void ConfigureServices(IServiceCollection services)
27
28
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
28
29
public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
29
30
{
31
+ var enUs = new CultureInfo ( "en-US" ) ;
32
+ CultureInfo . DefaultThreadCurrentCulture = enUs ;
33
+ CultureInfo . DefaultThreadCurrentUICulture = enUs ;
34
+
30
35
if ( env . IsDevelopment ( ) )
31
36
{
32
37
app . UseDeveloperExceptionPage ( ) ;
Original file line number Diff line number Diff line change 5
5
using Microsoft . Extensions . DependencyInjection ;
6
6
using Microsoft . Extensions . Hosting ;
7
7
using Microsoft . AspNetCore . Components . WebAssembly . Services ;
8
+ using System . Globalization ;
8
9
9
10
namespace TestServer
10
11
{
@@ -29,6 +30,10 @@ public void ConfigureServices(IServiceCollection services)
29
30
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
30
31
public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
31
32
{
33
+ var enUs = new CultureInfo ( "en-US" ) ;
34
+ CultureInfo . DefaultThreadCurrentCulture = enUs ;
35
+ CultureInfo . DefaultThreadCurrentUICulture = enUs ;
36
+
32
37
if ( env . IsDevelopment ( ) )
33
38
{
34
39
app . UseDeveloperExceptionPage ( ) ;
Original file line number Diff line number Diff line change
1
+ using System . Globalization ;
1
2
using Microsoft . AspNetCore . Builder ;
2
3
using Microsoft . AspNetCore . Hosting ;
3
4
using Microsoft . Extensions . Configuration ;
@@ -25,6 +26,10 @@ public void ConfigureServices(IServiceCollection services)
25
26
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
26
27
public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
27
28
{
29
+ var enUs = new CultureInfo ( "en-US" ) ;
30
+ CultureInfo . DefaultThreadCurrentCulture = enUs ;
31
+ CultureInfo . DefaultThreadCurrentUICulture = enUs ;
32
+
28
33
if ( env . IsDevelopment ( ) )
29
34
{
30
35
app . UseDeveloperExceptionPage ( ) ;
Original file line number Diff line number Diff line change
1
+ using System . Globalization ;
1
2
using System . IO ;
2
3
using Microsoft . AspNetCore . Builder ;
3
4
using Microsoft . AspNetCore . Hosting ;
@@ -26,6 +27,10 @@ public void ConfigureServices(IServiceCollection services)
26
27
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
27
28
public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
28
29
{
30
+ var enUs = new CultureInfo ( "en-US" ) ;
31
+ CultureInfo . DefaultThreadCurrentCulture = enUs ;
32
+ CultureInfo . DefaultThreadCurrentUICulture = enUs ;
33
+
29
34
if ( env . IsDevelopment ( ) )
30
35
{
31
36
app . UseDeveloperExceptionPage ( ) ;
Original file line number Diff line number Diff line change 1
1
// Copyright (c) .NET Foundation. All rights reserved.
2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
+ using System . Globalization ;
4
5
using Microsoft . AspNetCore . Builder ;
5
6
using Microsoft . AspNetCore . Hosting ;
6
7
using Microsoft . Extensions . Configuration ;
@@ -25,6 +26,10 @@ public void ConfigureServices(IServiceCollection services)
25
26
26
27
public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
27
28
{
29
+ var enUs = new CultureInfo ( "en-US" ) ;
30
+ CultureInfo . DefaultThreadCurrentCulture = enUs ;
31
+ CultureInfo . DefaultThreadCurrentUICulture = enUs ;
32
+
28
33
if ( env . IsDevelopment ( ) )
29
34
{
30
35
app . UseDeveloperExceptionPage ( ) ;
Original file line number Diff line number Diff line change @@ -138,6 +138,9 @@ private async Task DeleteBrowserUserProfileDirectoriesAsync()
138
138
{
139
139
var opts = new ChromeOptions ( ) ;
140
140
141
+ // Force language to english for tests
142
+ opts . AddUserProfilePreference ( "intl.accept_languages" , "en" ) ;
143
+
141
144
// Comment this out if you want to watch or interact with the browser (e.g., for debugging)
142
145
if ( ! Debugger . IsAttached )
143
146
{
You can’t perform that action at this time.
0 commit comments