public ActionResult GetModel(int id, string culture)
        {
            var productType = _repository.Find(id);

            var compared = Mapper.Map<ProductType, ProductTypeModel>(productType);
            var translated = new ProductTypeModel
            {
                Id = compared.Id,
                Name = compared.Name
            };

            // Difference of compared product type and the previous compared product type
            var diff = new ProductTypeModel
            {
                Id = compared.Id,
                Name = compared.Name
            };

            var entityKey = EntityKey.FromEntity(productType);
            var translation = _translationStore.Find(CultureInfo.GetCultureInfo(culture), entityKey);

            foreach (var field in compared.CustomFieldDefinitions)
            {
                translated.CustomFieldDefinitions.Add(LoadFieldTranslation(field, "CustomFieldDefinitions", translation));
                diff.CustomFieldDefinitions.Add(LoadFieldDiff(field, "CustomFieldDefinitions", translation));
            }
            foreach (var field in compared.VariantFieldDefinitions)
            {
                translated.VariantFieldDefinitions.Add(LoadFieldTranslation(field, "VariantFieldDefinitions", translation));
                diff.VariantFieldDefinitions.Add(LoadFieldDiff(field, "VariantFieldDefinitions", translation));
            }

            return Json(new
            {
                Compared = compared,
                Difference = diff,
                Translated = translated
            }, JsonRequestBehavior.AllowGet);
        }
        public ActionResult Translate(int id, string culture, ProductTypeModel model, string @return)
        {
            var entityKey = new EntityKey(typeof(ProductType), id);
            var productType = _repository.Find(model.Id);

            var props = new List<PropertyTranslation>();

            foreach (var field in model.CustomFieldDefinitions)
            {
                var originalField = productType.CustomFieldDefinitions.Find(field.Id);
                UpdateFieldTranslation(originalField, field, "CustomFieldDefinitions[" + field.Name + "].", props);
            }
            foreach (var field in model.VariantFieldDefinitions)
            {
                var originalField = productType.VariantFieldDefinitions.Find(field.Id);
                UpdateFieldTranslation(originalField, field, "VariantFieldDefinitions[" + field.Name + "].", props);
            }

            _translationStore.AddOrUpdate(CultureInfo.GetCultureInfo(culture), entityKey, props);

            return AjaxForm().RedirectTo(@return);
        }