 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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! 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
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?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
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 dirs = new Stack(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
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
This is great! thanks
It would great if the RESX comments were preserved too. That way you can help the translators see the context of the terms you have.
- aron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
ho visto i sources ed intuisco che questo funziona sse è installato Office2003 o 2005 ossia quelli che danno supporto di ToolLibrary a Dot.Net.
Immagino niente per versioni precedenti di Excel che usano invece l'oggetto COM vero ?
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Hi Marco,
I get an unhandled exception when running your project: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Resx2Xls.exe Additional information: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
The exception raises in Resx2XlsForm.DataSetToXls in line:
Excel.Workbook wb = app.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet); Perhaps an incompatibility with Office Excel? I've Excel 2003 installed.
Regards, Marco Vervoort - Pulse Business Solutions
|
| Sign In·View Thread·PermaLink | 3.50/5 (2 votes) |
|
|
|
 |
|
 |
That's a regional settings issue. (See http://support.microsoft.com/kb/320369 for more information)
There are 3 possible workarounds :
1. Manually set your regional settings to be the same than your excel's language.
2. Before using automation, switch the currentthread cultureinfo to en-us (en-us is apparently universal for automation, it works with any other language)
3. Install the Multilingual User Interface Pack for your version of Office. (see the kb article for the link)
Personally, I prefer switching the currentthread cultureinfo before using automation (and switch back once automation is complete).
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
Thanks, that solved the problem. You've already written the code in file Resx2XlsForm.cs at line 32-34, but commented it out. After removing the comment tags, it worked.
Great tool . Nice to translate the resources. It still needs some tweaking before I can use it, but it's a good starting point. Currenlty you only load the default culture, altough I already have a localized resource which is not imported into Excel. And I get an OUT_OF_MEMORY from Excel at about 240 labels. I think I have about 800 labels in my resouce file. But these are thinks I can solve by my selve :->.
You haven't imported the comment from the resource file. The default resouce reader (ResXResourceReader) doesn't load the comments. I would suggest using an XmlReader with a few more lines of code. The comment can be very valueable for translations .
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I had the same error. However I did not have Office installed.
I just installed Office 2003 and the error went away.
- aron
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
ResEx is a nice resource editor with support for multiple languages. What you can do with it:
Translate values side by side (just like the old time classic VB6 resource editor) Lock specific strings so that translator does not translate them Restrict length of translating strings Ensure correct translation of strings with placeholders {0} {1} ... Warnings about shortcut characters (string containing &) View resource strings in tree form Translate resources without Visual Studio IDE Search inside resource files while translating
You can find it here: http://www.papadi.gr/projects/resex.aspx
|
| Sign In·View Thread·PermaLink | 3.00/5 (2 votes) |
|
|
|
 |
|
 |
Thanks Edwin,
I've downloaded it and I can say it's a very good tool, with a very friendly interface. But it missises one of the main purpose of my project.
The purpose of this utility (at a very early stage) is to allow a developer to produce a Single Excel document containing ALL the Resx files of your project. I don't want to open each resx file, one at a time, translate it in all languages and so on....
Marco
|
| Sign In·View Thread·PermaLink | 1.80/5 (5 votes) |
|
|
|
 |