File tree Expand file tree Collapse file tree
cloudscribe.Web.Localization Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,8 +33,14 @@ public bool Match(
3333 {
3434 var cultureSettingsAccessor = httpContext . RequestServices . GetService < IOptions < RequestLocalizationOptions > > ( ) ;
3535 var cultureSettings = cultureSettingsAccessor . Value ;
36- var found = cultureSettings . SupportedUICultures . Where ( x => x . Name == requestFolder || x . TwoLetterISOLanguageName == requestFolder ) . Any ( ) ;
37- var isDefaultCulture = cultureSettings . DefaultRequestCulture . UICulture . Name == requestFolder || cultureSettings . DefaultRequestCulture . UICulture . TwoLetterISOLanguageName == requestFolder ;
36+ var found = cultureSettings . SupportedUICultures . Where ( x => x . Name . Equals ( requestFolder , System . StringComparison . InvariantCultureIgnoreCase )
37+ || x . TwoLetterISOLanguageName . Equals ( requestFolder , System . StringComparison . InvariantCultureIgnoreCase ) ) . Any ( ) ;
38+
39+ var isDefaultCulture = cultureSettings . DefaultRequestCulture . UICulture . Name . Equals ( requestFolder , System . StringComparison . InvariantCultureIgnoreCase )
40+ || cultureSettings . DefaultRequestCulture . UICulture . TwoLetterISOLanguageName . Equals ( requestFolder , System . StringComparison . InvariantCultureIgnoreCase ) ;
41+
42+
43+
3844 //don't match default culture because we don't want the culture segment in the url for the default culture
3945 if ( found && ! isDefaultCulture )
4046 {
Original file line number Diff line number Diff line change @@ -27,11 +27,14 @@ public override Task<ProviderCultureResult> DetermineProviderCultureResult(HttpC
2727
2828 if ( ! string . IsNullOrWhiteSpace ( pathStartingSegment ) )
2929 {
30- var matchingUICulture = _supportedUICultures . Where ( x => x . Name == pathStartingSegment || x . TwoLetterISOLanguageName == pathStartingSegment ) . FirstOrDefault ( ) ;
30+ var matchingUICulture = _supportedUICultures . Where ( x => x . Name . Equals ( pathStartingSegment , System . StringComparison . InvariantCultureIgnoreCase )
31+ || x . TwoLetterISOLanguageName . Equals ( pathStartingSegment , System . StringComparison . InvariantCultureIgnoreCase ) ) . FirstOrDefault ( ) ;
32+
3133 CultureInfo mainCulture = null ;
3234 if ( _supportedCultures != null )
3335 {
34- mainCulture = _supportedCultures . Where ( x => x . Name == pathStartingSegment || x . TwoLetterISOLanguageName == pathStartingSegment ) . FirstOrDefault ( ) ;
36+ mainCulture = _supportedCultures . Where ( x => x . Name . Equals ( pathStartingSegment , System . StringComparison . InvariantCultureIgnoreCase )
37+ || x . TwoLetterISOLanguageName . Equals ( pathStartingSegment , System . StringComparison . InvariantCultureIgnoreCase ) ) . FirstOrDefault ( ) ;
3538 }
3639 if ( matchingUICulture != null )
3740 {
Original file line number Diff line number Diff line change 22
33 <PropertyGroup >
44 <Description >more flexible localization for ASP.NET Core</Description >
5- <Version >3.0.0 </Version >
5+ <Version >3.0.1 </Version >
66 <Authors >Joe Audette</Authors >
77 <TargetFrameworks >netcoreapp3.0</TargetFrameworks >
88 <PackageId >cloudscribe.Web.Localization</PackageId >
99 <PackageTags >cloudscribe;localization;resx</PackageTags >
10- <PackageIconUrl >https://raw.githubusercontent.com/joeaudette/cloudscribe/master/cloudscribe- icon-32 .png</PackageIconUrl >
10+ <PackageIcon > icon.png</PackageIcon >
1111 <PackageProjectUrl >https://github.com/joeaudette/cloudscribe.Web.Localization</PackageProjectUrl >
1212 <PackageLicenseExpression >Apache-2.0</PackageLicenseExpression >
1313 <RepositoryUrl >https://github.com/cloudscribe/cloudscribe.Web.Localization.git</RepositoryUrl >
1414 <RepositoryType >git</RepositoryType >
1515
1616 </PropertyGroup >
1717
18+ <ItemGroup >
19+ <None Include =" icon.png" Pack =" true" PackagePath =" \" />
20+ </ItemGroup >
21+
1822 <ItemGroup >
1923 <FrameworkReference Include =" Microsoft.AspNetCore.App" />
2024 </ItemGroup >
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ public void ConfigureServices(IServiceCollection services)
4646 //services.AddLocalization();
4747 services . AddLocalization ( options => options . ResourcesPath = "GlobalResources" ) ;
4848
49+ services . AddRouting ( options =>
50+ {
51+ options . LowercaseUrls = true ;
52+ } ) ;
53+
4954 services . AddMvc ( )
5055 . AddRazorOptions ( options =>
5156 {
Original file line number Diff line number Diff line change 1010 <aspNetCore processPath =" %LAUNCHER_PATH%" arguments =" %LAUNCHER_ARGS%" stdoutLogEnabled =" false" stdoutLogFile =" .\logs\stdout" forwardWindowsAuthToken =" false" hostingModel =" InProcess" >
1111 <environmentVariables >
1212 <environmentVariable name =" ASPNETCORE_ENVIRONMENT" value =" Development" />
13+ <environmentVariable name =" COMPLUS_ForceENC" value =" 1" />
1314 </environmentVariables >
1415 </aspNetCore >
1516 </system .webServer>
You can’t perform that action at this time.
0 commit comments