Welcome Guest, you are in: Login

Search:

RESX Synchronizer

RSS
Modified on 2014/05/17 07:36 by Administrator Categorized as Uncategorized
RESX Synchronizer is a command-line tool that allows you to synchronize two or more multilanguage .resx files. This tool is released under the GPLv2 License.


1 - Overview

Certified by Softpedia

Certified by Softpedia

When you edit the .NET Resource files in Visual Studio, either manually and using the "Generate Local Resources" command, the IDE updates only the culture-invariant resources: if you have a resource file called Messages.aspx, the files in other languages, say Messages.it-IT.resx, are not updated, and you have to do that manually. RESX Synchronizer will help you keep the resource files synchronized, adding the new keys to the localized files, and removing the deleted ones. Comments are preserved during the process.

2 - Usage

The usage is very simple. The most basic operation is:

resxsync Messages.resx Messages.it-IT.resx

This command updates the file Messages.it-IT.resx, applying the changes found in Messages.resx.

You can also synchronize all the non-culture-invariant files with a single command:

resxsync Messages.resx *

This command updates all the .resx files with the same basename of Messages.resx, i.e. any file whose name matches the pattern Messages.xx-XX.resx or Messages.xx.resx, where xx-XX and xx are language codes.

2.1 - Options

You can specify different options (all the options must be specified after the source and destination parameters):

  • /b - Backup: creates a backup copy of the destination file(s) before modifying them.
  • /a - Add-only: only adds new keys without removing the deleted ones.
  • /m - Mute: does not displays the final statistics of the synchronization (count of added and removed keys).
  • /v - Verbose: displays each added or removed key/value pair.
  • /c - Create: creates the destination if it does not exist.
  • /l - Embedded Resources only: synchronize only embedded resources, without considering linked resources.

3 - Command Line Reference

The command-line reference for RESX Synchronizer is reported below.

resxsync source destination [options]

   source          The source RESX file
   destination     The destination file, or the asterisk (*)
   [options]       (must be specified after source and destination)
      /b           Creates a backup of the destination file before modifying it
      /a           Adds only new keys, without removing the deleted ones
      /m           Does not display the results after the synchronization
      /v           Displays the added and removed keys
      /c           Creates the destination if it does not exist
      /l           Synchronizes embedded resources only

4 - RESX Synchronizer in Action

Assume you have the following resource files, containing some key/value pairs.

Messages.resx
Title = ScrewTurn Wiki
Description = A powerful Wiki software
Author = ScrewTurn Software

Messages.it-IT.resx
Title = ScrewTurn Wiki
Description = Un potente software Wiki
Author = ScrewTurn Software

Assume you remove the property Author and add a new property in the file Messages.aspx:
MyMessage = Click here to login

You can now use RESX Synchronizer:
resxsync Messages.resx Messages.it-IT.resx

The file Messages.it-IT.resx will become:
Title = ScrewTurn Wiki
Description = Un potente engine Wiki
MyMessage = Click here to login

MyMessage is now ready to be translated.

5 - Download

RESX Synchronizer is available for download in binary and source form under the GPLv2 License.


Did you find a bug? Please report it in our Forum.

6 - How it Works

You might find useful to take a look at an article on The Code Project, describing how this tool works.

7 - History

2008/02/17 - Version 1.3, provided by Roman Morawek
  • Added various comments to make the code easier to read
  • Fixed a bug that prevented to get a real unique filename for the temporary file
  • Added check for illegal command line switches
  • Added check to avoid overwriting destination file if sync did not change it to preserve the original file date

Side Projects

  • RESX Synchronizer allows to synchronize multi-language .resx files (used for the development of ScrewTurn Wiki).
  • Pixel Picker enables to pick the color of pixels on your screen — very handy for day-to-day graphics-related activities.

About