TomsToolbox.JsonToResX 1.0.4

dotnet tool install --global TomsToolbox.JsonToResX --version 1.0.4
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local TomsToolbox.JsonToResX --version 1.0.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=TomsToolbox.JsonToResX&version=1.0.4
                    
nuke :add-package TomsToolbox.JsonToResX --version 1.0.4
                    

JsonToResX

Build status NuGet Status

A DotNet command line tool to convert .json resrouces files used in angular to .resx files and vice versa.

Intention of this tool

In Angular applications, it is common to use .json files for localization. However, in .NET applications, the standard is to use .resx files. This tool allows you to convert between these two formats easily, so you can work with localization in both environments without hassle.

For example, you can use it to convert your Angular localization files into .resx files to be able to use comfortable localization tools like ResXResourceManager, that support automatic translations and many checks and verifications, and then convert the .resx files back to .json files for use in your Angular application.

Conventions

In .json files, the keys are commonly delimited by dots, e.g. app.title, app.subtitle, while in .resx files the keys are usually delimited by underscores, e.g. app_title, app_subtitle. This tool will convert the keys accordingly, so you work in both environments seamlessly.

The Angular translations loader replaces placeholders like {{name}} with the actual values at runtime. However, in .resx files, ResXResourceManager expects named placeholders in the format ${name}. This tool will convert the placeholders accordingly, so you can take advantage of the placeholder validation features provided by ResXResourceManager.

Sample

Input (Test.json)

{
  "app.title": "My Application",
  "app.subtitle": "Welcome to my application",
  "app.greeting": "Hello {{name}}"
}

Output (Test.resx)

<?xml version="1.0" encoding="utf-8"?>
<root>
  ...
  <data name="app_title" xml:space="preserve">
    <value>My Application</value>
  </data>
  <data name="app_subtitle" xml:space="preserve">
    <value>Welcome to my application</value>
  </data>
  <data name="app_greeting" xml:space="preserve">
    <value>Hello ${name}</value>
  </data>
</root>

Installation

dotnet tool install TomsToolbox.JsonToResX -g

Usage

Usage: JsonToResX [--help] [--version] input output

JsonToResX

Arguments:
  0: input      (Required)
  1: output     (Required)

Options:
  -h, --help    Show help message
  --version     Show version

Example

dotnet tool install TomsToolbox.JsonToResX -g
JsonToResX Resources.json Resources.resx
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.4 325 8/11/2025
1.0.3 495 7/25/2025
1.0.2 554 7/24/2025
1.0.1 601 7/23/2025
1.0.0 600 7/23/2025