Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Localization Rule #16153 #16154

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
<TargetFrameworks>$(CommonTargetFrameworks)</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="Localization\zh-CN\OrchardCore.Demo.po">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\OrchardCore\OrchardCore.Module.Targets\OrchardCore.Module.Targets.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.Extensions.Localization;

namespace ModuleSample.Services;
public class TestLocalizationService
{
private readonly IStringLocalizer S;

public TestLocalizationService(IStringLocalizer<TestLocalizationService> stringLocalizer)
{
S = stringLocalizer;
}

public string SayHello()
{
return S["This is an internationalisation rule test."];
}
}
12 changes: 12 additions & 0 deletions test/OrchardCore.Tests.Modules/ModuleSample/Startup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.Extensions.DependencyInjection;
using ModuleSample.Services;
using OrchardCore.Modules;

namespace ModuleSample;
public class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<TestLocalizationService>();
}
}
Loading