Source/NFX.Wave/Portal.cs
/// <summary>
/// Localizes record model schema:field:value
/// </summary>
Localizes record model schema:field:value
Localizes record model schema : field : value
protected virtual string DoLocalizeRecordModel(string schema, string field, string value, string isoLang)
      {
        if (value.IsNullOrWhiteSpace()) return value;
        if (!m_LocalizationData.Exists) return value;
        if (isoLang.IsNullOrWhiteSpace())
        {
          var session = ExecutionContext.Session;
          if (session==null) return value;
          isoLang = session.LanguageISOCode;
        }
        if (isoLang.IsNullOrWhiteSpace())
         isoLang = DefaultLanguageISOCode;
        if (isoLang.EqualsOrdIgnoreCase(CoreConsts.ISO_LANG_ENGLISH)) return value;
        if (schema.IsNullOrWhiteSpace()) schema = LOC_ANY_SCHEMA_KEY;
        if (field.IsNullOrWhiteSpace())  field = LOC_ANY_FIELD_KEY;
        bool exists;
        var lv = DoLookupLocalizationValue(isoLang, schema, field, value, out exists);
        if (DumpLocalizationErrors && !exists)
        {
            App.Log.Write( new Message{
              Type = MessageType.InfoZ,
              From = "lookup",
              Topic = CoreConsts.LOCALIZATION_TOPIC,
              Text = "Need localization",
              Parameters = (new {iso = isoLang, sch = schema, fld = field, val = value }).ToJSON()
            });
        }
        return lv;
      }
protected virtual string DoLocalizeRecordModel ( string schema , string field , string value , string isoLang ) { if ( value . IsNullOrWhiteSpace ( ) ) return value ; if ( ! m_LocalizationData . Exists ) return value ; if ( isoLang . IsNullOrWhiteSpace ( ) ) { var session = ExecutionContext . Session ; if ( session == null ) return value ; isoLang = session . LanguageISOCode ; } if ( isoLang . IsNullOrWhiteSpace ( ) ) isoLang = DefaultLanguageISOCode ; if ( isoLang . EqualsOrdIgnoreCase ( CoreConsts . ISO_LANG_ENGLISH ) ) return value ; if ( schema . IsNullOrWhiteSpace ( ) ) schema = LOC_ANY_SCHEMA_KEY ; if ( field . IsNullOrWhiteSpace ( ) ) field = LOC_ANY_FIELD_KEY ; bool exists ; var lv = DoLookupLocalizationValue ( isoLang , schema , field , value , out exists ) ; if ( DumpLocalizationErrors && ! exists ) { App . Log . Write ( new Message { Type = MessageType . InfoZ , From = " " , Topic = CoreConsts . LOCALIZATION_TOPIC , Text = " " , Parameters = ( new { iso = isoLang , sch = schema , fld = field , val = value } ) . ToJSON ( ) } ) ; } return lv ; }
Localizes record model schema:field:value
Localizes record model schema : field : value
//nowhere to lookup //Use this to find out what strings need translation
schema
string
field
string
value
string
isoLang
string