Source/NFX.Wave/Portal.cs
/// <summary>
/// Tries to determine session/work context lang and returns it or DefaultLanguageISOCode
/// </summary>
Tries to determine session/work context lang and returns it or DefaultLanguageISOCode
Tries to determine session / work context lang and returns it or DefaultLanguageISOCode
public virtual string GetLanguageISOCode(WorkContext work = null)
      {
        string lang = null;
        if (work==null)
          work = ExecutionContext.Request as WorkContext;
        if (work==null)
        {
          var session = ExecutionContext.Session;
          if (session!=null)
           lang = session.LanguageISOCode;
        }
        else
        {
          work.NeedsSession(onlyExisting: true);
          var session = work.Session;
          if (session!=null)
            lang = session.LanguageISOCode;
          if (lang.IsNullOrWhiteSpace() && work.GeoEntity!=null && work.GeoEntity.Location.HasValue)
          {
            var country = work.GeoEntity.CountryISOName;
            lang =  CountryISOCodeToLanguageISOCode(country);
          }
        }
        return lang.IsNullOrWhiteSpace() ? this.DefaultLanguageISOCode : lang;
      }
public virtual string GetLanguageISOCode ( WorkContext work = null ) { string lang = null ; if ( work == null ) work = ExecutionContext . Request as WorkContext ; if ( work == null ) { var session = ExecutionContext . Session ; if ( session != null ) lang = session . LanguageISOCode ; } else { work . NeedsSession ( onlyExisting : true ) ; var session = work . Session ; if ( session != null ) lang = session . LanguageISOCode ; if ( lang . IsNullOrWhiteSpace ( ) && work . GeoEntity != null && work . GeoEntity . Location . HasValue ) { var country = work . GeoEntity . CountryISOName ; lang = CountryISOCodeToLanguageISOCode ( country ) ; } } return lang . IsNullOrWhiteSpace ( ) ? this . DefaultLanguageISOCode : lang ; }
Tries to determine session/work context lang and returns it or DefaultLanguageISOCode
Tries to determine session / work context lang and returns it or DefaultLanguageISOCode
// 9/13/2016 OGee session can be exists but not acquired
work
WorkContext