public static string TranslatedElement <T>(this TranslatableElement <T> element, Expression <Func <T, string> > property) { string fallback = GetPropertyRouteAccesor(property)(element.Value); PropertyRoute route = element.ElementRoute.Continue(property); return(TranslatedField(element.Lite, route, element.RowId, fallback)); }
public static T SaveTranslation <T>(this T entity, CultureInfoEntity ci, Expression <Func <T, string> > propertyRoute, string translatedText) where T : Entity { entity.Save(); if (translatedText.HasText()) { new TranslatedInstanceEntity { PropertyRoute = PropertyRoute.Construct(propertyRoute).ToPropertyRouteEntity(), Culture = ci, TranslatedText = translatedText, OriginalText = GetPropertyRouteAccesor(propertyRoute)(entity), Instance = entity.ToLite(), } }