Localize using strongly typed resources:
generated Class with
strotygen -p -t Yavsc.Models.IT.Fixing.Bug.resx
must be modified :
* prefix with 'Yavsc.Server.Resources.' the baseName
in call to new System.Resources.ResourceManager
* remove the internal ctor
additionally, the generated class must be or unique or partial
This commit is contained in:
parent
b9a75b71b8
commit
9501ee1f16
13 changed files with 342 additions and 44 deletions
6
src/test/Mandatory/YavscMandatory.cs → src/test/Mandatory/BatchTests.cs
Executable file → Normal file
6
src/test/Mandatory/YavscMandatory.cs → src/test/Mandatory/BatchTests.cs
Executable file → Normal file
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Builder.Internal;
|
||||
using Microsoft.AspNet.Razor;
|
||||
|
|
@ -29,13 +29,13 @@ namespace test
|
|||
|
||||
[Collection("Yavsc mandatory success story")]
|
||||
[Trait("regres", "no")]
|
||||
public class YavscMandatory: BaseTestContext, IClassFixture<ServerSideFixture>, IDisposable
|
||||
public class BatchTests: BaseTestContext, IClassFixture<ServerSideFixture>, IDisposable
|
||||
{
|
||||
|
||||
ApplicationDbContext _dbContext;
|
||||
ServerSideFixture _fixture;
|
||||
|
||||
public YavscMandatory(ITestOutputHelper output, ServerSideFixture fixture) : base (output, fixture)
|
||||
public BatchTests(ITestOutputHelper output, ServerSideFixture fixture) : base (output, fixture)
|
||||
{
|
||||
_dbContext = fixture.DbContext;
|
||||
_fixture = fixture;
|
||||
23
src/test/Mandatory/Resources.cs
Normal file
23
src/test/Mandatory/Resources.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
namespace test {
|
||||
public class ResxResources {
|
||||
const string resPath = "Resources/Test.TestResources.resx";
|
||||
|
||||
public void HaveAResxLoader()
|
||||
{
|
||||
System.Resources.ResourceReader loader = new System.Resources.ResourceReader(resPath);
|
||||
// IDictionary
|
||||
var etor = loader.GetEnumerator();
|
||||
while (etor.Current !=null)
|
||||
{
|
||||
byte[] data;
|
||||
string stringdata;
|
||||
string resName = etor.Key.ToString();
|
||||
|
||||
loader.GetResourceData(resName, out stringdata, out data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue