();
+ }
+
+ [Fact]
+ public void Should_Localize()
+ {
+ using (AbpCultureHelper.Use("en"))
+ {
+ _templateLocalizer.Localize(_testResource, "{{#L:CarPlural}} {{#L:Universe}}
")
+ .ShouldBe("Cars Universe
");
+ }
+ }
+
+ [Fact]
+ public void Should_Work_Even_If_No_Text_To_Localize()
+ {
+ using (AbpCultureHelper.Use("en"))
+ {
+ _templateLocalizer.Localize(_testResource, "test
")
+ .ShouldBe("test
");
+ }
+ }
+
+ [DependsOn(typeof(AbpTestBaseModule))]
+ [DependsOn(typeof(AbpLocalizationModule))]
+ public class TestModule : AbpModule
+ {
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ context.Services.Configure(options =>
+ {
+ options.FileSets.AddEmbedded();
+ });
+
+ context.Services.Configure(options =>
+ {
+ options.Resources
+ .Add("en")
+ .AddVirtualJson("/Volo/Abp/Localization/TestResources/Source");
+ });
+ }
+ }
+ }
+}
diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json
index 974f7081d0..0388b6efe2 100644
--- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json
+++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json
@@ -4,6 +4,7 @@
"Hello {0}.": "Hello {0}.",
"Car": "Car",
"CarPlural": "Cars",
- "MaxLenghtErrorMessage": "This field's length can be maximum of '{0}' chars"
+ "MaxLenghtErrorMessage": "This field's length can be maximum of '{0}' chars",
+ "Universe": "Universe"
}
}
\ No newline at end of file
diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/tr.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/tr.json
index ff92ed51bd..fa2d23246b 100644
--- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/tr.json
+++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/tr.json
@@ -3,6 +3,7 @@
"texts": {
"Hello {0}.": "Merhaba {0}.",
"Car": "Araba",
- "CarPlural": "Araba"
+ "CarPlural": "Araba",
+ "Universe": "Evren"
}
}
\ No newline at end of file