Ejemplo n.º 1
0
 public static string ExecuteTranslateNameOrDescr(L10N data, bool isName, string lang = null)
 {
     if (data == null)
     {
         data = new L10N();
         data.InitializeField();
     }
     return(isName ? ExecuteLang(data, lang).Name ?? "" : ExecuteLang(data, lang).Description ?? "");
 }
Ejemplo n.º 2
0
        public static LangField ExecuteLang(string data, string lang = null)
        {
            var tmp = new L10N();

            tmp.InitializeField();
            if (string.IsNullOrWhiteSpace(data))
            {
                return(ExecuteLang(tmp, lang));
            }

            var instance = data.ToSpecificModel <L10N>();

            tmp.En = instance.En ?? tmp.En;
            tmp.Ru = instance.Ru ?? tmp.Ru;
            tmp.Es = instance.Es ?? tmp.Es;
            return(ExecuteLang(tmp, lang));
        }