|
This application does not allow for existing translations and is therefore limited in use. Got my hopes up briefly.
|
|
|
|
|
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.
|
|
|
|
|
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?
|
|
|
|
|
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?
|
|
|
|
|
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
|
|
|
|
|
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)
|
|
|
|
|
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.
|
|
|
|
|
Hi,
your changes looks very interesting... can You please upload it (I need comments support too)
a lot of thanks
Vlad
|
|
|
|
|
I'm interest too. Don't hesitate to send your code.
|
|
|
|
|
|
Would love to see the refactored version -- need the comments.
Cheers,
Charax
|
|
|
|
|
This utility saved me a ton of work. Thanks a bunch. I really appreciate you sharing this with the community.
One item I needed to do to prevent numeric values with leading zeros and booleans from being interpreted as their native types in Excel was to force the entire sheet to be formatted as Text. With this set, everything comes in as a literal and nothing is altered.
Here's what I added to DataSetToXls(ResxData rd, string fileName) after the instantiation of "sheet" but before any values are written to the cells:
// format sheet as Text so that numeric, date or boolean values aren't
// interpreted as their native types and subsequently altered
sheet.get_Range("A1", "A1").EntireColumn.EntireRow.NumberFormat = "@";
Also, I contacted Patrick Mortara for his additions that pull in existing translations - works nice. This allows me to maintain translations in the RESX files, yet enables me to extract existing translations whenever maintenance is done on the app that adds new strings. I'm not really that keen on having a spreadsheet be the master translation source. It becomes just another source file to maintain, in this case needlessly.
|
|
|
|
|
It works very well. Only 2 minor issues: the culture thing for excel interop and excel still runs after quitting the program. To stop this behaviour the Excel.Application app should be set to null after calling Quit() on it.
What kind of license do you have on this code? I'd like to change several aspects of the code and use the tool in house to assist translating some of our applications.
[Update]
Okay found out on http://resx2xls.codeplex.com that is is released under LGPL 2.1
modified on Monday, November 30, 2009 4:52 AM
|
|
|
|
|
I tried setting app to null, but it doesn't actually fix the problem (I still have an instance of EXCEL running when the application exits). Is there something else we have to do?
Thanks,
mzappit
|
|
|
|
|
I have added the following:
<br />
wb.Close(false, Type.Missing, Type.Missing);<br />
app.Quit();<br />
while (Marshal.ReleaseComObject(app) != 0)<br />
{<br />
}<br />
<br />
app = null;<br />
GC.Collect();<br />
GC.WaitForPendingFinalizers();<br />
Also for every COM object a Marshal.ReleaseComObject(object) call should be done. I have completely refactored the code. I have also added features, every resx file gets its own workbook for example. I can send you a copy if you want.
|
|
|
|
|
Please do. I was just looking at needing to do the same, so if you can save me some time with something you've already done, I would be eternally grateful.
--mzappit
|
|
|
|
|
The autor sems inactive. I made a continuaton of he project with my changes at google code:
http://code.google.com/p/resx2xls/
|
|
|
|
|
Actually, we did the exact same thing 2 days before... I can't believe it!
The author of the tool is actually not inactive, he is helping us to update the tool.
You can find our repository here: http://code.google.com/p/xls-localization-tool/
We added few things such as generation of properties file for Java application.
A new release should be coming soon. Do you want to merge?
Matthias
|
|
|
|
|
It works great but it has a little bug.
After execution when going from XLS to RESX leaves an Excel instance running behind. You can check it through Task Manager. The simpler solution is just killing the instance using Task Manager.
other then that.. a great tool!
|
|
|
|
|
Thanks for this very handy tool. You mentioned that it can be used to clean up unused strings. I couldn't figure out how to do that. I obtained the list of keys in xls. Do i still manually need to
look for references to the key in my code OR is this already done in a simpler way.
Thanks for the help.
|
|
|
|
|
Hello,
first of all: Thank you for this tool. It's exactly what i was searching for. I just have a little problem with it. My Project already contains resx files for 1 additional language (german). When creating the xls file with your tool, the contents of these resx files are not exported. Is there a possibility to include already existing translations into the xls file?
greetings,
Patrick
|
|
|
|
|
I agree...I was about to put the exact same coomments! I love the tool...just need to grab the existing tranlations too so that we do not have to retranlate for words already tranlated.
Anyone want to try and tackle this problem?
|
|
|
|
|
I already hacked the tool to output existing translations. Contact me if you are interested.
Now i'm having a new problem. When you make layout changes for specific languages, these get lost when reimporting the excel sheets. I'm trying to find solutions for this too.
My plan is to contact the original author when i'm done.
|
|
|
|
|
Any way you can throw in the Comment tag in the resx file upon generation?
|
|
|
|
|
Hello,
I found this program works great with the GlobalResources, however with the App_LocalResources, it creates duplicated files for each language. If you have the same problem, check out the script below. I put it on the web form + wire it to a button click, and it deletes the extra files and keeps the ones you need. - Yes I know this is a cheap "band aid solution" but its quick and worked 4 me.
public partial class Temp_RemoveBadLocalFiles : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string folder = @"C:\Users\aron\Documents\Visual Studio 2008\WebSites\TheaterSalesCorporate\App_LocalResources\";
Label1.Text = TraverseTree(folder);
}
public string TraverseTree(string root)
{
StringBuilder sb = new StringBuilder();
// Data structure to hold names of subfolders to be
// examined for files.
Stack<string> dirs = new Stack<string>(20);
if (!System.IO.Directory.Exists(root))
{
throw new ArgumentException();
}
dirs.Push(root);
while (dirs.Count > 0)
{
string currentDir = dirs.Pop();
string[] subDirs;
try
{
subDirs = System.IO.Directory.GetDirectories(currentDir);
}
// An UnauthorizedAccessException exception will be thrown if we do not have
// discovery permission on a folder or file. It may or may not be acceptable
// to ignore the exception and continue enumerating the remaining files and
// folders. It is also possible (but unlikely) that a DirectoryNotFound exception
// will be raised. This will happen if currentDir has been deleted by
// another application or thread after our call to Directory.Exists. The
// choice of which exceptions to catch depends entirely on the specific task
// you are intending to perform and also on how much you know with certainty
// about the systems on which this code will run.
catch (UnauthorizedAccessException e)
{
sb.Append(e.Message);
continue;
}
catch (System.IO.DirectoryNotFoundException e)
{
sb.Append(e.Message);
continue;
}
string[] files = null;
try
{
files = System.IO.Directory.GetFiles(currentDir);
}
catch (UnauthorizedAccessException e)
{
sb.Append(e.Message);
continue;
}
catch (System.IO.DirectoryNotFoundException e)
{
sb.Append(e.Message);
continue;
}
// Perform the required action on each file here.
// Modify this block to perform your required task.
foreach (string file in files)
{
try
{
// Perform whatever action is required in your scenario.
System.IO.FileInfo fi = new System.IO.FileInfo(file);
if ((fi.Name.Substring(2, 1).Equals(".")) || ((fi.Name.Substring(0, 6).Equals("zh-CHS"))))
{
sb.AppendFormat("DELETED FILE: {0}: {1}, {2} ", fi.Name, fi.Length, fi.CreationTime);
fi.Delete();
}
else
{
sb.AppendFormat("GOOD FILE: {0}: {1}, {2} ", fi.Name, fi.Length, fi.CreationTime);
}
}
catch (System.IO.FileNotFoundException e)
{
// If file was deleted by a separate application
// or thread since the call to TraverseTree()
// then just continue.
sb.Append(e.Message);
continue;
}
}
// Push the subdirectories onto the stack for traversal.
// This could also be done before handing the files.
foreach (string str in subDirs)
dirs.Push(str);
}
return sb.ToString();
}
}
- aron
|
|
|
|