ReGenSource 0.4.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package ReGenSource --version 0.4.1
                    
NuGet\Install-Package ReGenSource -Version 0.4.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ReGenSource" Version="0.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ReGenSource" Version="0.4.1" />
                    
Directory.Packages.props
<PackageReference Include="ReGenSource" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ReGenSource --version 0.4.1
                    
#r "nuget: ReGenSource, 0.4.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ReGenSource@0.4.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ReGenSource&version=0.4.1
                    
Install as a Cake Addin
#tool nuget:?package=ReGenSource&version=0.4.1
                    
Install as a Cake Tool

ReGenSource

I hate RESX files.

There. I said it.

I hate them because they are a pain to work with. They are not human-readable, they are not merge-friendly, they are never consistent in tabs/spaces or comments, and they are a pain to manage.

I hate them so much that I decided to write a tool to replace them.

What is ReGenSource?

ReGenSource is a tool that generates source code with localized resources from a JSON file.

How can I use this in my project?

Step one is to create a JSON file with the resources you want to localize. The file name must end with .res.json.

The JSON file must be added to your project file, along with a reference to the ReGenSource package.

<ItemGroup>
    <AdditionalFiles Include="Resources.res.json" />
    <PackageReference Include="ReGenSource" Version="0.1.0-ci.17" />
</ItemGroup>

The JSON file should be structured like this:

{
   "namespace": "MyApp.Resources",
   "class": "MyResources",
   "resources": [
      {
         "name": "Welcome",
         "default": "Welcome to my application",
         "translations": {
            "pt": "Bem-vindo ao meu aplicativo",
            "nb,nn": "Velkommen til min applikasjon"
         }
      }
   ]
}

Namespace

The namespace is the namespace that the generated class will be placed in.

By default, the namespace is ReGenSource.

Class

The class is the name of the class that will be generated.

By default, the class is Resources.

Resources

The resources is an array of resources that will be generated. Each resource has a name, a default value, and a set of translations. The default value is used when no translation is found for the current culture.

CultureDefinition

By default the culture is defined by the Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName property. This is what is compared with the translation languages.

If you need a different way to define the culture, you can add a CultureDefinition property to the JSON file. This property should be a string that will be used as the culture definition in the generated code.

"CultureDefinition": "global::System.Threading.Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName"

ClassAccessModifier

By default the class is generated as a public class. It can however be set as internal by overriding the ClassAccessModifier property:

"ClassAccessModifier": "Internal"

Resources

Name

The name of the resource, used as the property name in the generated class.

Default

This is the translation to fallback to when no other translation is found for the given language.

Translations

Keys support comma-separated values to allow for multiple languages to be used for the same translation.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0-dependabot-nuget-src-... 31 3/16/2026
0.5.0-dependabot-nuget-src-... 28 3/16/2026
0.5.0-dependabot-nuget-src-... 33 3/16/2026
0.5.0-dependabot-github-act... 31 2/24/2026
0.5.0-dependabot-github-act... 31 3/9/2026
0.5.0-dependabot-docker-src... 31 3/16/2026
0.4.1 3,261 2/24/2026
0.4.1-dependabot-nuget-src-... 46 2/16/2026
0.4.1-dependabot-nuget-src-... 50 1/20/2026
0.4.1-dependabot-github-act... 68 1/20/2026
0.4.1-dependabot-docker-src... 48 2/16/2026
0.4.1-dependabot-docker-src... 40 1/20/2026
0.4.1-ci.9 64 2/16/2026
0.4.1-ci.8 60 2/16/2026
0.4.1-ci.7 66 1/20/2026
0.4.1-ci.6 63 1/20/2026
0.4.1-ci.5 61 1/20/2026
0.4.1-ci.4 58 1/20/2026
0.4.1-ci.3 399 12/10/2025
0.4.1-ci.2 393 12/10/2025
Loading failed