mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +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.Web.Mvc;
|
||||
using Orchard.Core.Settings.Models;
|
||||
@@ -74,11 +75,15 @@ namespace Orchard.Core.Settings.Controllers {
|
||||
}
|
||||
|
||||
[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")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
_cultureManager.AddCulture(cultureName);
|
||||
cultureName = string.IsNullOrWhiteSpace(cultureName) ? systemCultureName : cultureName;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(cultureName)) {
|
||||
_cultureManager.AddCulture(cultureName);
|
||||
}
|
||||
return RedirectToAction("Culture");
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,8 @@
|
||||
@Html.ValidationSummary()
|
||||
<fieldset class="addCulture">
|
||||
<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>
|
||||
</fieldset>
|
||||
}
|
||||
|
@@ -185,7 +185,6 @@ namespace Orchard.Setup.Services {
|
||||
// add default culture
|
||||
var cultureManager = environment.Resolve<ICultureManager>();
|
||||
cultureManager.AddCulture("en-US");
|
||||
cultureManager.AddCulture("fr");
|
||||
|
||||
var contentManager = environment.Resolve<IContentManager>();
|
||||
|
||||
|
Reference in New Issue
Block a user