mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Globalization;
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Orchard.Core.Settings.Models;
|
using Orchard.Core.Settings.Models;
|
||||||
@@ -74,11 +75,15 @@ namespace Orchard.Core.Settings.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public ActionResult AddCulture(string cultureName) {
|
public ActionResult AddCulture(string systemCultureName, string cultureName) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings")))
|
if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
|
cultureName = string.IsNullOrWhiteSpace(cultureName) ? systemCultureName : cultureName;
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(cultureName)) {
|
||||||
_cultureManager.AddCulture(cultureName);
|
_cultureManager.AddCulture(cultureName);
|
||||||
|
}
|
||||||
return RedirectToAction("Culture");
|
return RedirectToAction("Culture");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,7 +7,8 @@
|
|||||||
@Html.ValidationSummary()
|
@Html.ValidationSummary()
|
||||||
<fieldset class="addCulture">
|
<fieldset class="addCulture">
|
||||||
<label for="CultureName">@T("Add a culture...")</label>
|
<label for="CultureName">@T("Add a culture...")</label>
|
||||||
@Html.DropDownList("CultureName", new SelectList(Model.AvailableSystemCultures.OrderBy(s => s), Model.CurrentCulture))
|
@Html.DropDownList("SystemCultureName", new SelectList(Model.AvailableSystemCultures.OrderBy(s => s), Model.CurrentCulture))
|
||||||
|
@T("Other"): @Html.TextBox("CultureName")
|
||||||
<button class="primaryAction" type="submit">@T("Add")</button>
|
<button class="primaryAction" type="submit">@T("Add")</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
}
|
}
|
||||||
|
@@ -185,7 +185,6 @@ namespace Orchard.Setup.Services {
|
|||||||
// add default culture
|
// add default culture
|
||||||
var cultureManager = environment.Resolve<ICultureManager>();
|
var cultureManager = environment.Resolve<ICultureManager>();
|
||||||
cultureManager.AddCulture("en-US");
|
cultureManager.AddCulture("en-US");
|
||||||
cultureManager.AddCulture("fr");
|
|
||||||
|
|
||||||
var contentManager = environment.Resolve<IContentManager>();
|
var contentManager = environment.Resolve<IContentManager>();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user