コード例 #1
0
        public IActionResult TranslationsList()
        {
            var model = new TranslationsListModel();

            FillBaseModel(model);
            model.Translations = _localizationService.GetAllTranslations();

            return(View(model));
        }
コード例 #2
0
        private List <TranslationInfoModel> GetTranslationsForLocale(int localeId)
        {
            var allTranslationsResult = _translationService.GetAllTranslations();

            if (!allTranslationsResult.Success)
            {
                return(null);
            }

            var allTranslationsForLocale = allTranslationsResult.Value
                                           .Where(x => x.LocaleId == localeId)
                                           .ToList();

            var allTranslationsForLocaleModels = _mapper.Map <List <TranslationInfoModel> >(allTranslationsForLocale);

            return(allTranslationsForLocaleModels);
        }