mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Some work on the content localization UI
--HG-- branch : dev
This commit is contained in:
@@ -9,7 +9,6 @@ using Orchard.Localization;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Mvc.Results;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Core.Localization.Controllers {
|
||||
[ValidateInput(false)]
|
||||
@@ -32,9 +31,15 @@ namespace Orchard.Core.Localization.Controllers {
|
||||
public ActionResult Translate(int id, string to) {
|
||||
var contentItem = _contentManager.Get(id, VersionOptions.Latest);
|
||||
|
||||
// only support translations from the site culture, at the moment at least
|
||||
if (contentItem == null)
|
||||
return new NotFoundResult();
|
||||
|
||||
if (!contentItem.Is<Localized>() || contentItem.As<Localized>().MasterContentItem != null) {
|
||||
var metadata = _contentManager.GetItemMetadata(contentItem);
|
||||
return RedirectToAction(Convert.ToString(metadata.EditorRouteValues["action"]), metadata.EditorRouteValues);
|
||||
}
|
||||
|
||||
var siteCultures = _cultureManager.ListCultures().Where(s => s != _localizationService.GetContentCulture(contentItem));
|
||||
var model = new AddLocalizationViewModel {
|
||||
Id = id,
|
||||
|
Reference in New Issue
Block a user