mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-07 16:13:58 +08:00
Compare commits
1 Commits
4268b28d95
...
feature/li
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f3fe88f6ea |
37
src/Orchard.Web/Modules/Orchard.Translations/AdminMenu.cs
Normal file
37
src/Orchard.Web/Modules/Orchard.Translations/AdminMenu.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Linq;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
namespace Orchard.Translations {
|
||||
public class AdminMenu : INavigationProvider {
|
||||
private readonly ICultureManager _cultureManager;
|
||||
|
||||
public AdminMenu(ICultureManager cultureManager) {
|
||||
_cultureManager = cultureManager;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.AddImageSet("blog")
|
||||
.Add(T("Blog"), "1.5", BuildMenu);
|
||||
}
|
||||
|
||||
private void BuildMenu(NavigationItemBuilder menu) {
|
||||
var cultures = _cultureManager.ListCultures();
|
||||
var cultureCount = cultures.Count();
|
||||
var singleCulture = cultureCount == 1 ? cultures.ElementAt(0) : null;
|
||||
|
||||
if (cultureCount > 0 && singleCulture == null) {
|
||||
menu.Add(T("Translations"), "10.0",
|
||||
item => item.Action("Index", "TranslationAdmin", new { area = "Orchard.Translations" }));
|
||||
}
|
||||
else if (singleCulture != null)
|
||||
menu.Add(T("Translations"), "10.0",
|
||||
item => item.Action("Edit", "TranslationAdmin", new { area = "Orchard.Translations", cultureName = singleCulture }));
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,78 @@
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Translations.Services;
|
||||
using Orchard.UI.Admin;
|
||||
|
||||
namespace Orchard.Translations.Controllers {
|
||||
[Admin]
|
||||
[ValidateInput(false)]
|
||||
public class TranslationAdminController : Controller, IUpdateModel {
|
||||
private readonly ICultureManager _cultureManager;
|
||||
private readonly ITranslationsManager _translationManager;
|
||||
|
||||
public TranslationAdminController(ICultureManager cultureManager,
|
||||
IShapeFactory shapeFactory,
|
||||
ITranslationsManager translationManager) {
|
||||
_cultureManager = cultureManager;
|
||||
_translationManager = translationManager;
|
||||
|
||||
Logger = NullLogger.Instance;
|
||||
Shape = shapeFactory;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
dynamic Shape { get; set; }
|
||||
protected ILogger Logger { get; set; }
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public ActionResult Index() {
|
||||
var cultureNames = _cultureManager.ListCultures();
|
||||
|
||||
var statistics = cultureNames
|
||||
.Select(cultureName => _translationManager.GetStatistic(cultureName))
|
||||
.ToList();
|
||||
|
||||
var viewModel = Shape.ViewModel()
|
||||
.Statistics(statistics);
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
public ActionResult Edit(string cultureName) {
|
||||
var statistic = _translationManager.GetStatistic(cultureName);
|
||||
|
||||
var translatableFeatures = _translationManager.GetTranslatableProjects(cultureName);
|
||||
|
||||
var viewModel = Shape.ViewModel()
|
||||
.Statistic(statistic)
|
||||
.Translatable(translatableFeatures);
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
public ActionResult Reset(string cultureName) {
|
||||
_translationManager.Reset(cultureName);
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
public ActionResult Delete(string cultureName) {
|
||||
_translationManager.Delete(cultureName);
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
||||
return TryUpdateModel(model, prefix, includeProperties, excludeProperties);
|
||||
}
|
||||
|
||||
void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) {
|
||||
ModelState.AddModelError(key, errorMessage.ToString());
|
||||
}
|
||||
}
|
||||
}
|
25
src/Orchard.Web/Modules/Orchard.Translations/Migrations.cs
Normal file
25
src/Orchard.Web/Modules/Orchard.Translations/Migrations.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Orchard.Data.Migration;
|
||||
|
||||
namespace Orchard.Translations {
|
||||
public class RolesDataMigration : DataMigrationImpl {
|
||||
|
||||
public int Create() {
|
||||
SchemaBuilder.CreateTable("TranslatableRecord",
|
||||
table => table
|
||||
.Column<int>("Id", column => column.PrimaryKey().Identity())
|
||||
.Column<string>("Location")
|
||||
.Column<string>("Value")
|
||||
);
|
||||
|
||||
SchemaBuilder.CreateTable("TranslatedRecord",
|
||||
table => table
|
||||
.Column<int>("Id", column => column.PrimaryKey().Identity())
|
||||
.Column<int>("Parent_Id")
|
||||
.Column<int>("Culture_Id")
|
||||
.Column<string>("Value")
|
||||
);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
namespace Orchard.Translations.Models {
|
||||
public interface ITranslatableProject {}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace Orchard.Translations.Models {
|
||||
public interface ITranslationStatistic {
|
||||
CultureInfo Culture { get; set; }
|
||||
int Translated { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace Orchard.Translations.Models {
|
||||
public class TranslatableRecord {
|
||||
public virtual int Id { get; set; }
|
||||
public static string Location { get; set; }
|
||||
public static string Value { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
using Orchard.Localization.Records;
|
||||
|
||||
namespace Orchard.Translations.Models {
|
||||
public class TranslatedRecord {
|
||||
public virtual int Id { get; set; }
|
||||
public virtual TranslatableRecord Parent { get; set; }
|
||||
public virtual CultureRecord Culture { get; set; }
|
||||
public virtual string Value { get; set; }
|
||||
}
|
||||
}
|
9
src/Orchard.Web/Modules/Orchard.Translations/Module.txt
Normal file
9
src/Orchard.Web/Modules/Orchard.Translations/Module.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Name: Translations Management
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.8.1
|
||||
OrchardVersion: 1.8
|
||||
Description: The Orchard Translations module allows dynamic editing of transations from the admin screens.
|
||||
Dependencies: Orchard.Localization
|
||||
Category: Content
|
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Orchard.Translations</RootNamespace>
|
||||
<AssemblyName>Orchard.Translations</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Migrations.cs" />
|
||||
<Compile Include="Models\ITranslatableFeatures.cs" />
|
||||
<Compile Include="Models\ITranslationStatistic.cs" />
|
||||
<Compile Include="Models\TranslatableRecord.cs" />
|
||||
<Compile Include="Models\TranslatedRecord.cs" />
|
||||
<Compile Include="Services\ITranslationsManager.cs" />
|
||||
<Compile Include="Controllers\TranslationAdminController.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Placement.info">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\TranslationAdmin\Index.cshtml" />
|
||||
<Content Include="Views\TranslationAdmin\Edit.cshtml" />
|
||||
<None Include="web.Debug.config">
|
||||
<DependentUpon>web.config</DependentUpon>
|
||||
</None>
|
||||
<None Include="web.Release.config">
|
||||
<DependentUpon>web.config</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard.Framework</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>51089</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:51089/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
@@ -0,0 +1,2 @@
|
||||
<Placement>
|
||||
</Placement>
|
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Orchard.Translations")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Orchard.Translations")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("fb690629-a581-4299-a02b-9e487ed3103b")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -0,0 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Orchard.Data;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Translations.Models;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Translations.Services {
|
||||
public interface ITranslationsManager : IDependency {
|
||||
ITranslationStatistic GetStatistic(string cultureName);
|
||||
IEnumerable<ITranslatableProject> GetTranslatableProjects(string cultureName);
|
||||
void Reset(string cultureName);
|
||||
void Delete(string cultureName);
|
||||
}
|
||||
|
||||
public class TranslationsManager : ITranslationsManager {
|
||||
private readonly IRepository<TranslatableRecord> _translatableRecordRepository;
|
||||
private readonly IRepository<TranslatedRecord> _translatedRecordRepository;
|
||||
|
||||
public TranslationsManager(IRepository<TranslatableRecord> translatableRecordRepository,
|
||||
IRepository<TranslatedRecord> translatedRecordRepository) {
|
||||
_translatableRecordRepository = translatableRecordRepository;
|
||||
_translatedRecordRepository = translatedRecordRepository;
|
||||
}
|
||||
|
||||
public ITranslationStatistic GetStatistic(string cultureName) {
|
||||
var translatedCount = _translatedRecordRepository.Count(x => x.Culture.Culture == cultureName);
|
||||
|
||||
return new TranslationStatistic {
|
||||
Culture = CultureInfo.GetCultureInfo(cultureName),
|
||||
Translated = translatedCount
|
||||
};
|
||||
}
|
||||
|
||||
public IEnumerable<ITranslatableProject> GetTranslatableProjects(string cultureName) {
|
||||
var translatableRecords = _translatableRecordRepository.Table.ToList();
|
||||
var translatedRecords = _translatedRecordRepository.Fetch(x => x.Culture.Culture == cultureName);
|
||||
|
||||
foreach (var translatableRecord in translatableRecords) {
|
||||
var translatedRecord = translatedRecords.SingleOrDefault(x => x.Parent.Id == translatableRecord.Id);
|
||||
yield return new TranslatableProject {
|
||||
TranslatableRecord = translatableRecord,
|
||||
TranslatedRecord = translatedRecord
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset(string cultureName) {
|
||||
Delete(cultureName);
|
||||
}
|
||||
|
||||
public void Delete(string cultureName) {
|
||||
var records = _translatedRecordRepository.Fetch(x => x.Culture.Culture == cultureName);
|
||||
foreach (var record in records) {
|
||||
_translatedRecordRepository.Delete(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TranslatableProject : ITranslatableProject {
|
||||
public TranslatableRecord TranslatableRecord { get; set; }
|
||||
public TranslatedRecord TranslatedRecord { get; set; }
|
||||
}
|
||||
|
||||
public class TranslationStatistic : ITranslationStatistic {
|
||||
public CultureInfo Culture { get; set; }
|
||||
public int Translated { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
@using Orchard.Translations.Models
|
||||
@{
|
||||
Layout.Title = T("Translations").ToString();
|
||||
|
||||
var translationStatistics = (IList<ITranslationStatistic>) Model.Statistics;
|
||||
}
|
||||
<p>TODO: total translatable recorsds shown as a global figure</p>
|
||||
<p>TODO: Check for orphaned translations</p>
|
||||
<fieldset>
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">@T("Culture")</th>
|
||||
<th scope="col">@T("Translated")</th>
|
||||
<th scope="col">@T("Orphaned")</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (var translationStatistic in translationStatistics) {
|
||||
var cultureName = translationStatistic.Culture.Name;
|
||||
<tr>
|
||||
<td>@translationStatistic.Culture.DisplayName</td>
|
||||
<td>@translationStatistic.Translated</td>
|
||||
<td>0</td>
|
||||
<td>
|
||||
@Html.ActionLink(T("Edit").ToString(), "Edit", new { cultureName }) |
|
||||
@Html.ActionLink(T("Reflush").ToString(), "Flush", new { cultureName }) |
|
||||
@Html.ActionLink(T("Reset").ToString(), "Reset", new { cultureName }, new { itemprop = "UnsafeUrl" }) |
|
||||
@Html.ActionLink(T("Delete").ToString(), "Delete", new { cultureName }, new { itemprop = "RemoveUrl UnsafeUrl" })
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
||||
</fieldset>
|
@@ -0,0 +1,35 @@
|
||||
@using Orchard.Translations.Models
|
||||
@{
|
||||
Layout.Title = T("Translations").ToString();
|
||||
|
||||
var translationStatistics = (IList<ITranslationStatistic>) Model.Statistics;
|
||||
}
|
||||
<p>TODO: total translatable recorsds shown as a global figure</p>
|
||||
<p>TODO: Check for orphaned translations</p>
|
||||
<fieldset>
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">@T("Culture")</th>
|
||||
<th scope="col">@T("Translated")</th>
|
||||
<th scope="col">@T("Orphaned")</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (var translationStatistic in translationStatistics) {
|
||||
var cultureName = translationStatistic.Culture.Name;
|
||||
<tr>
|
||||
<td>@translationStatistic.Culture.DisplayName</td>
|
||||
<td>@translationStatistic.Translated</td>
|
||||
<td>0</td>
|
||||
<td>
|
||||
@Html.ActionLink(T("Edit").ToString(), "Edit", new { cultureName }) |
|
||||
@Html.ActionLink(T("Reflush").ToString(), "Flush", new { cultureName }) |
|
||||
@Html.ActionLink(T("Reset").ToString(), "Reset", new { cultureName }, new { itemprop = "UnsafeUrl" }) |
|
||||
@Html.ActionLink(T("Delete").ToString(), "Delete", new { cultureName }, new { itemprop = "RemoveUrl UnsafeUrl" })
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
||||
</fieldset>
|
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
37
src/Orchard.Web/Modules/Orchard.Translations/web.config
Normal file
37
src/Orchard.Web/Modules/Orchard.Translations/web.config
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<remove name="host"/>
|
||||
<remove name="pages"/>
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
<add namespace="System.Web.Mvc.Ajax"/>
|
||||
<add namespace="System.Web.Mvc.Html"/>
|
||||
<add namespace="System.Web.Routing"/>
|
||||
<add namespace="System.Web.WebPages"/>
|
||||
<add namespace="System.Linq"/>
|
||||
<add namespace="System.Collections.Generic"/>
|
||||
<add namespace="Orchard.Mvc.Html"/>
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
<system.web>
|
||||
<compilation targetFramework="4.5">
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
</assemblies>
|
||||
</compilation>
|
||||
</system.web>
|
||||
</configuration>
|
@@ -1,6 +1,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30501.0
|
||||
VisualStudioVersion = 12.0.30723.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}"
|
||||
EndProject
|
||||
@@ -243,6 +243,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.MediaServices
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AuditTrail", "Orchard.Web\Modules\Orchard.AuditTrail\Orchard.AuditTrail.csproj", "{3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Translations", "Orchard.Web\Modules\Orchard.Translations\Orchard.Translations.csproj", "{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
CodeCoverage|Any CPU = CodeCoverage|Any CPU
|
||||
@@ -1008,6 +1010,16 @@ Global
|
||||
{3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.Coverage|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.FxCop|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -1087,5 +1099,6 @@ Global
|
||||
{7528BF74-25C7-4ABE-883A-443B4EEC4776} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{14A96B1A-9DC9-44C8-A675-206329E15263} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{D7BA5371-36CB-4382-9FC0-8898EFCFA3EE} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
Reference in New Issue
Block a user