File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
dotnet/src/dotnetframework/GxClasses/Core Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -3459,7 +3459,7 @@ internal void SetSession(IGxSession value)
34593459
34603460 public int SetLanguage ( string id )
34613461 {
3462- if ( Config . GetLanguageProperty ( id , "code" ) != null )
3462+ if ( Config . ValidLanguage ( id ) )
34633463 {
34643464 SetProperty ( GXLanguage , id ) ;
34653465 _localUtil = GXResourceManager . GetLocalUtil ( id ) ;
@@ -3473,7 +3473,7 @@ public int SetLanguage(string id)
34733473 }
34743474 private int SetLanguageWithoutSession ( string id )
34753475 {
3476- if ( Config . GetLanguageProperty ( id , "code" ) != null )
3476+ if ( Config . ValidLanguage ( id ) )
34773477 {
34783478 SetContextProperty ( GXLanguage , id ) ;
34793479 _localUtil = GXResourceManager . GetLocalUtil ( id ) ;
Original file line number Diff line number Diff line change @@ -280,6 +280,22 @@ public static string MapCustomError(string code)
280280 return null ;
281281 }
282282#endif
283+ internal static bool ValidLanguage ( string language )
284+ {
285+ if ( languages != null )
286+ return languages . Contains ( language ) ;
287+ else
288+ {
289+ #if NETCORE
290+ return false ;
291+ #else
292+ #pragma warning disable CS0618 // Type or member is obsolete
293+ Hashtable appsettings = ( Hashtable ) ConfigurationSettings . GetConfig ( "languages/" + language ) ;
294+ #pragma warning restore CS0618 // Type or member is obsolete
295+ return ( appsettings != null ) ;
296+ #endif
297+ }
298+ }
283299 public static string GetLanguageProperty ( string language , string property )
284300 {
285301 string sString = null ;
You can’t perform that action at this time.
0 commit comments