What Was I Thinking?

Follies & Foils of .NET Development
posts - 95 , comments - 352 , trackbacks - 0

Resource String Editing Made Easy

I'm working on a project that involves building a library of string resources.  Some of these resource values are small, consisting of a sentence or two, other resources are actually embedded XSL's, and can be quite lengthy.  Visual Studio's built-in resource editor might suffice for other resource types, but is painfully inadequate for a large resource strings.

My experience with the Visual Studio editor involves waiting 45-70 seconds for the initial data grid of strings to load, and another 30 seconds of re-rendering before the grid becomes responsive.  Clicking between resource entries can take up to 20 seconds, as the data grid resizes for each resource entry. All with a resource file containing less than 100 strings. As I said, painfully inadequate.

As a lazy developer, my first response is often "I'll bet someone else has had this problem" and I  headed off to Google.  Although there are dozens of 3rd party resource editors, none of them did everything I needed in a string resource editor.  It needed to be fast, directly read/write to .resx files, support find and replace, and accept the resource filename as a command line parameter.  The closest I came was Lutz Roeder's Resourcer.  The problem with his editor (as with many of the others), is his use of a textbox as the resource value edit control.  Textbox's length limit is simply too short to handle large XSL streams.

It's a good thing I know C#.

Using .Net's ResxReader and ResxWriter, a ListView here (a personal favorite UI control), RichEdit Textbox there, and POOF! We're got ourselves a lean mean resource editing machine.  I wrote my own implementation of Find and Replace (borrowing heavily from the Visual Studio Find and Replace dialog for style and UI design).

Once installed the .Net Resource String Editor can load or create a .resx resource file,  either passed as a command line argument or using the menu options.  The list of Resource strings is auto sorted by default and enforces unique resources names within the file.  The editor also support a MRU list (Most Recently Used), so you have quick access to your recent resource files.

I've integrated the editor in my visual studio IDE by configuring it as the default editor for .resx files.  To configure Visual Studio, Right click on a resx file in your project in the Solution Explorer, choose Open With, Add a new tool (point it the resourceditor.exe), Set the new tool as the default. Now when you double-click your resx file in the Visual Studio solution explorer, it will be opened in the .NET Resource String Editor.

If you'd care to experience a pain-free string resource editing experience, you can download the .Net Resource String Editor setup from here, just be sure to rename the .msi_ file to .msi before running the installation. 

DotNet Resource String Editor-lg


Download the .NET Resource String Editor


Jan 15, 2008 - Update:  A new version is available.  I fixed a bug in the resource value not updating in the listview before a save, and now support user-selected color schemes.

If you download this application, be so kind as to leave a comment on your thoughts. 


March 4, 2008 - Update: A new version is available.  I've added support for resource string comments.  Like resource string values, you can view, search, and replace resource string comments. The comment editor panel color scheme can be customized like the rest of the UI elements.   Comments can be viewed/hidden from the View menu and persists custom view settings.  A recommended update for anyone using the old version.

Print | posted on Sunday, January 13, 2008 9:42 PM | Filed Under [ Visual Studio ]



# re: Resource String Editing Made Easy

downloaded, installed, and using. Great stuff; simple and gets the job done. My only request would be that you throw in a quick column on the right to edit the comment field of each resource. I find myself using those more often then not. Also, I noticed that it just deleted any comments that I had in the comment tags prior to using it :(
3/3/2008 2:51 PM | rzurad

# re: Resource String Editing Made Easy

I don't suppose there's any chance of getting source for this? Looks *almost* exactly what I need.
8/5/2008 5:51 AM | Helen

# re: Resource String Editing Made Easy

I downloaded your Resource String Editor 3/24/2009 but do not see support for comments. You state in your March 4, 2008 update that you added support for comments. I followed the link on this page.
3/24/2009 3:05 PM | Lettia

# re: Resource String Editing Made Easy

You can enable resource comments by opening the resource file in the editor and selecting "Resource Comments" from the view menu or pressing Ctrl+M.
3/27/2009 2:18 PM | wtfChris

# re: Resource String Editing Made Easy

Very nice, but the AutoSort keeps being selected by default every time. I want it to be off, so file is not sorted when saved. What can I do?
3/11/2012 9:22 AM | splintor
Post A Comment

Powered by: