private string TranslateNutrient(NutrientLanguageNames nutrientTranslator, string name, string displayName, NutrientViewModel nutrientViewModel) { var nutrientTranslations = nutrientTranslator.TranslateNutrient(name, "label", this.LanguageCode); if (nutrientTranslations.Any()) { displayName = nutrientTranslations.First().Name; nutrientViewModel.Order = nutrientTranslations.First().Order; nutrientViewModel.IsSubCategory = !(nutrientViewModel.Order == 1 || nutrientViewModel.Order % 10 == 0); } nutrientViewModel.DisplayName = displayName; return(displayName); }
private string TranslateNutrient(NutrientLanguageNames nutrientTranslator, string name, string displayName, NutrientViewModel nutrientViewModel) { var nutrientTranslations = nutrientTranslator.TranslateNutrient(name, "label", Product.LanguageCode); int order = 1; if (nutrientTranslations.Any()) { displayName = nutrientTranslations.First().Name; order = nutrientTranslations.First().Order; } nutrientViewModel.DisplayName = displayName; return(displayName); }