mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Adding TranslationService to Core
This commit is contained in:
@@ -10,19 +10,13 @@ using Orchard.Security;
|
|||||||
namespace Orchard.Core.Common.Drivers {
|
namespace Orchard.Core.Common.Drivers {
|
||||||
public class CommonPartDriver : ContentPartDriver<CommonPart> {
|
public class CommonPartDriver : ContentPartDriver<CommonPart> {
|
||||||
private readonly IContentManager _contentManager;
|
private readonly IContentManager _contentManager;
|
||||||
private readonly IAuthenticationService _authenticationService;
|
|
||||||
private readonly IAuthorizationService _authorizationService;
|
|
||||||
private readonly IMembershipService _membershipService;
|
private readonly IMembershipService _membershipService;
|
||||||
|
|
||||||
public CommonPartDriver(
|
public CommonPartDriver(
|
||||||
IOrchardServices services,
|
IOrchardServices services,
|
||||||
IContentManager contentManager,
|
IContentManager contentManager,
|
||||||
IAuthenticationService authenticationService,
|
|
||||||
IAuthorizationService authorizationService,
|
|
||||||
IMembershipService membershipService) {
|
IMembershipService membershipService) {
|
||||||
_contentManager = contentManager;
|
_contentManager = contentManager;
|
||||||
_authenticationService = authenticationService;
|
|
||||||
_authorizationService = authorizationService;
|
|
||||||
_membershipService = membershipService;
|
_membershipService = membershipService;
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
Services = services;
|
Services = services;
|
||||||
|
|||||||
13
src/Orchard/Localization/Services/ITranslationService.cs
Normal file
13
src/Orchard/Localization/Services/ITranslationService.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System.Globalization;
|
||||||
|
|
||||||
|
namespace Orchard.Localization.Services {
|
||||||
|
public interface ITranslationService : IDependency {
|
||||||
|
string Translate(CultureInfo from, CultureInfo to, string value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DefaultTranslationService : ITranslationService {
|
||||||
|
public string Translate(CultureInfo from, CultureInfo to, string value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -280,6 +280,7 @@
|
|||||||
<Compile Include="Localization\Services\IDateFormatter.cs" />
|
<Compile Include="Localization\Services\IDateFormatter.cs" />
|
||||||
<Compile Include="Localization\Services\IDateTimeFormatProvider.cs" />
|
<Compile Include="Localization\Services\IDateTimeFormatProvider.cs" />
|
||||||
<Compile Include="Localization\Services\ILocalizedStringManager.cs" />
|
<Compile Include="Localization\Services\ILocalizedStringManager.cs" />
|
||||||
|
<Compile Include="Localization\Services\ITranslationService.cs" />
|
||||||
<Compile Include="Localization\Services\PersianDateTimeFormatInfo.cs" />
|
<Compile Include="Localization\Services\PersianDateTimeFormatInfo.cs" />
|
||||||
<Compile Include="Localization\Services\SiteCalendarSelector.cs" />
|
<Compile Include="Localization\Services\SiteCalendarSelector.cs" />
|
||||||
<Compile Include="Logging\OrchardFileAppender.cs" />
|
<Compile Include="Logging\OrchardFileAppender.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user