File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
eFormAPI/eFormAPI/Infrastructure/Attributes Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 44using System . Threading ;
55using System . Threading . Tasks ;
66using System . Web . Configuration ;
7+ using Castle . Core . Internal ;
78using Microsoft . Owin ;
89
910namespace eFormAPI . Web . Infrastructure . Attributes
@@ -19,16 +20,20 @@ public override async Task Invoke(IOwinContext context)
1920 {
2021 var claimsPrincipal = context . Authentication ? . User ;
2122 var locale = claimsPrincipal ? . Claims . SingleOrDefault ( x => x . Type == "locale" ) ? . Value ;
22- if ( locale == null )
23+ if ( locale . IsNullOrEmpty ( ) )
2324 {
2425 var configuration = WebConfigurationManager . OpenWebConfiguration ( "~" ) ;
2526 var section = ( AppSettingsSection ) configuration . GetSection ( "appSettings" ) ;
2627
2728 var defaltLocale = section . Settings [ "general:defaultLocale" ] ? . Value ;
28- if ( string . IsNullOrEmpty ( defaltLocale ) )
29+ if ( ! defaltLocale . IsNullOrEmpty ( ) )
2930 {
3031 SetCultureOnThread ( defaltLocale ) ;
3132 }
33+ else
34+ {
35+ SetCultureOnThread ( "en-US" ) ;
36+ }
3237 await Next . Invoke ( context ) ;
3338 return ;
3439 }
You can’t perform that action at this time.
0 commit comments