Locale.
Inheritance: FanObj
Ejemplo n.º 1
0
Archivo: Env.cs Proyecto: nomit007/f4
        public virtual string locale(Pod pod, string key, string def, Locale locale)
        {
            object val;
              Duration maxAge = Duration.m_maxVal;

              // 1. 'props(pod, `locale/{locale}.props`)'
              val = props(pod, locale.m_strProps, maxAge).get(key, null);
              if (val != null) return (string)val;

              // 2. 'props(pod, `locale/{lang}.props`)'
              val = props(pod, locale.m_langProps, maxAge).get(key, null);
              if (val != null) return (string)val;

              // 3. 'props(pod, `locale/en.props`)'
              val = props(pod, m_localeEnProps, maxAge).get(key, null);
              if (val != null) return (string)val;

              // 4. Fallback to 'pod::key' unless 'def' specified
              if (def == m_noDef) return pod + "::" + key;
              return def;
        }