cirup is a command-line tool for working with localization resource files.
It supports .json, .resx, and .restext files.
Build the workspace:
cargo build --workspaceRun help:
cargo run -p cirup_cli -- --helpUse an installed binary:
cirup --help-v,-vv, ...: increase log verbosity.-C,--show-changes: forfile-diff, include keys that exist in both files but have different values.--touch: force writing output files even when generated bytes are identical.
By default, cirup avoids rewriting output files when content has not changed.
cirup file-print input.resxWrite the printed content to a file:
cirup file-print input.resx output.jsoncirup file-convert input.resx output.json
cirup file-convert input.json output.restextSort in place:
cirup file-sort strings.jsonSort to a separate file:
cirup file-sort strings.json strings.sorted.jsonShow keys present in file1 but missing in file2:
cirup file-diff file1.resx file2.resxWrite diff to file:
cirup file-diff file1.resx file2.resx diff.resxInclude value changes as well:
cirup --show-changes file-diff file1.resx file2.resxMerge values from file2 into file1:
cirup file-merge file1.resx file2.resx merged.resxKeep only exact key/value pairs common to both files:
cirup file-intersect file1.json file2.json intersect.jsonKeep values from file1 whose keys are not in file2:
cirup file-subtract file1.restext file2.restext result.restextShow keys that are in new, not in old, and also present in base:
cirup diff-with-base old.resx new.resx base.resx- Default: if output bytes are unchanged, cirup does not rewrite the file.
- With
--touch: cirup always rewrites output files.
Examples:
cirup file-sort strings.resx
cirup --touch file-sort strings.resxThe Devolutions.Cirup.Build package can run cirup operations during MSBuild.
Example project setup:
<ItemGroup>
<PackageReference Include="Devolutions.Cirup.Build" Version="1.2.3" PrivateAssets="all" />
<CirupResources Include="Properties\Resources.resx" />
<CirupResources Include="Properties\Resources.fr.resx" />
</ItemGroup>Run local end-to-end validation:
pwsh ./nuget/test-e2e.ps1cirup is also available as a RID-specific dotnet tool package: Devolutions.Cirup.Tool.
Install globally:
dotnet tool install -g Devolutions.Cirup.Tool
cirup --helpRun one-shot without permanent install:
dotnet tool exec Devolutions.Cirup.Tool -- --help
dnx Devolutions.Cirup.Tool --helpCreate local dotnet tool packages from prebuilt release artifacts:
pwsh ./nuget/pack-cirup-dotnet-tool.ps1 -Version 1.2.3 -ArtifactsRoot ./dist -OutputDir ./dist/nugetcargo test --workspace
cargo fmt --all --check
cargo clippy --workspace --all-targets