Click here to Skip to main content
Click here to Skip to main content

RESX to XLS conversion for multi-language support

By , 25 Jul 2007
 

Resx2Xls ScreenShot

Introduction

Do you need to localize your RESX files and don't want to open them one file at a time, clean them of unused keys, localize them etc., etc.? Then Resx2Xls is for you.

  1. Open Resx2xls. Click on "Create new Excel document...," select your Project Root and follow the wizard. Done!!
  2. Fill your Excel file with your localized key values or just send it to your translator.
  3. Now, do you want to create the localized RESX files from the filled Excel workbook? Open Resx2xls, click on "Generate resx files...," select your Excel file, click Next and then click Finish. Done!!
  4. Have you updated your project after your resource files were modified/added/removed/updated? No problem. Open Resx2xls, click on "Update your Excel document...," click Next, select your Project Root and Excel document and click Finish. Done!!

Thanks go to Manish Ranjan Kumar and his WizardBase control. It has helped me to give the application a more decent style.

Background

I was frustrated with copying my project resource files created in VS 2005, cleaning them of unused keys and then localizing them one file at a time. This tool should help you to just point and click at your project and obtain an Excel file filled with all of the strings of ALL of your resource files. After compiling the XLS with the translations, I wanted to convert all of the keys back into localized RESX files. I hope this helps!

Points of interest

I've had some problems loading resources with the ResxResourceReader class. I've noticed that if you have an image resource stored in the resource file, the path of the image in the XML document is relative to the document itself, not the project. Opening from another directory, i.e. Resx2xls bin, I get a "cannot parse" path exception. This was solved by setting the BasePath property of the resource reader with the path to the RESX file.

History

  • 25-7-2007: Article edited and posted to the main CodeProject article base
  • 5-7-2007: Added wizard
  • 4-7-2007: First release

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Marco Roello
Web Developer
Italy Italy
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionReading values from Excel to Resx not workingmemberMember 24544004 Feb '13 - 14:32 
The Excel file generates correctly, but when I try to convert that back to a Resx file, none of my values are there- the KEYS are all there, but all the values are blank.
 
Can you let me know what is that i am missing.
 
Thanks.
QuestionResx files don't contain key valuesmemberjsabo29 Nov '12 - 11:32 
The Excel file generates correctly, but when I try to convert that back to a Resx file, none of my values are there- the KEYS are all there, but all the values are blank.
 
What am I doing wrong?
BugThai characters not supportedmemberbarboul16 Apr '12 - 18:47 
This software doesn't work for Thai language. It has an unhandled error and crash by saying there are 'illegal characters in path' when I try to generate the resx files from the Excel file. Any help concerning this issue? Confused | :confused:
Questiondifferent cultures and unused keysmemberlevanlevi20 Mar '12 - 22:53 
I've question about cultures. I used the soft as you described and it loads only default .resx file. for ex. - Default.aspx.resx but not - Default.aspx.en-US.resx. Is it correct?
One more question abour unused keys. How do you eliminate them ?
 
Thanks for you work
GeneralRe: different cultures and unused keysmemberRagunath26.R29 Nov '12 - 2:41 
The same problem which i am also getting for example we have 11 languages in application when i try to get xls from the application its getting only the eng contents other values are not getting.
the reason for this in the executable source code is,
 
sheet.Cells[row, col + 5] = lr.Value;
 
in the below method private void DataSetToXls(ResxData rd, string fileName)
GeneralRefactored Version with Object-Oriented Structurememberrosaink5 May '10 - 8:37 
As part of a localization project, my team has refactored the source code to separate the control and conversion logic from the user interface code. Our primary need was to obtain Comment texts from the project resource files. Changes are as follows:
 
  • Added "Comment" and "IsRTF" columns to primary table in dataset (Resx)
  • Added all necessary supporting code to accommodate Comment fields in/out of .resx files
  • For RTF resource strings, creates hyperlinks for primary and secondary language files and places RTF values in linked-to files
  • Freeze top two rows in Excel output
  • Freeze leftmost critical columns in Excel output
  • Additional Excel cell, column and row formatting where appropriate (colors, borders, etc)
 
Several new classes have been added for easier extensibility:
 
  • Resx: handles in/out from .resx files
  • Xls: handles Excel file in/out
  • Specs: groups all wizard-collected parameters
  • StringResources: isolates reading from .resx files and provides an enumerator with C# yield to return only when string resources are obtained
  • ResxNode: a wrapper of the .NET ResXDataNode class
  • ResxFile: low-level handling and utility for .resx files
  • PathUtils
  • StringUtils
 
We are finalizing testing in the next few days and will post a version (here or in a new post) as soon as completed. If anyone has something on their wish list, now is a good time to let me know.
GeneralRe: Refactored Version with Object-Oriented StructurememberVladyslav Piskarov27 May '10 - 6:03 
Hi,
 
your changes looks very interesting... can You please upload it (I need comments support too)
 
a lot of thanks
 
Vlad
GeneralRe: Refactored Version with Object-Oriented Structuremembergutsfun31 May '10 - 22:03 
I'm interest too. Don't hesitate to send your code.
GeneralRe: Refactored Version with Object-Oriented Structurememberdmwason5 Aug '10 - 10:24 
I also need the same !!
GeneralRe: Refactored Version with Object-Oriented StructurememberCharax15 Sep '12 - 3:14 
Would love to see the refactored version -- need the comments.
 
Cheers,
 
Charax

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 25 Jul 2007
Article Copyright 2007 by Marco Roello
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid