public ActionResult Index()
        {
            var contentType = _contentTypeRepository.Load(CurrentPage.ContentTypeID);
            var model       = new SingleTranslationsViewModel
            {
                ContentTypeName = contentType.Name,
                Translations    = _translationService.TranslationsFor(contentType.Name)
            };

            return(View("~/LanguageTool/Interaction/Views/Plugin.cshtml", model));
        }
Beispiel #2
0
        public SingleTranslationsViewModel[] ModelsForAllTranslations()
        {
            var models    = new List <SingleTranslationsViewModel>();
            var typeNames = _contentTypeRepository.List().Select(t => t.Name).ToArray();

            foreach (var name in typeNames)
            {
                var translations = _translationRepository.TranslationsFor(name, ignoreLanguage: false).ToArray();
                if (!translations.Any())
                {
                    continue;
                }
                var innerModel = new SingleTranslationsViewModel
                {
                    ContentTypeName = name,
                    Translations    = translations
                };
                models.Add(innerModel);
            }
            models.Add(GlobalTranslationsModel());
            return(models.ToArray());
        }