ResxCodeGenerator 1.4.0
See the version list below for details.
dotnet add package ResxCodeGenerator --version 1.4.0
NuGet\Install-Package ResxCodeGenerator -Version 1.4.0
<PackageReference Include="ResxCodeGenerator" Version="1.4.0" />
paket add ResxCodeGenerator --version 1.4.0
#r "nuget: ResxCodeGenerator, 1.4.0"
// Install ResxCodeGenerator as a Cake Addin #addin nuget:?package=ResxCodeGenerator&version=1.4.0 // Install ResxCodeGenerator as a Cake Tool #tool nuget:?package=ResxCodeGenerator&version=1.4.0
ResxCodeGenerator
Generates strongly typed wrapper classes. Include contants for each string resource. Avoid the usage of "magic string". Ensure code and resource file coherence.
The generated classes are named with the same name as their associated resx. These classes can then be used as follows:
file : MyResource.en.resx
@inject IMyResourceLocalizer Localizer
<span>@Localizer.Hello</span>
As the designated solution for localization is to use IStringLocalizer.
Usage
- Install the package
Install-Package ResxCodeGenerator
- Define .resx files
- On the paramters of the resx set <generation action> to "additionnal c# analyzer file"
in csproj this look like this
<ItemGroup>
<AdditionalFiles Include="*.en.resx" />
</ItemGroup>
❗ N.B. - Set this option for only one language per resource. Otherwise, the generated classes will conflict.
License
MIT
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ResxCodeGenerator:
Package | Downloads |
---|---|
ResxCodeGenerator
A code generator for .resx files |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release