Resource Refactoring Tool allows easy extraction of hard-coded strings from Visual Basic, C# and XAML code to resx files.
This tool have originally been published on CodePlex. I have added support for VS 2010 and XAML and allowed to use any resx file from it.
But the VS2010 version only partially works for me (VS2010 SP1 on W7 64-bit):
- extracting the string to a resource file works - the preview is broken: line numbers stop counting at 255, with no visible indication of any changes to the source - the extracted resource does not replace the original string(s) in the source file
Seems to work quite well and saves a lot of time. Two requests: 1. Don't use the fully-qualified name of the resource class if there's a 'using' statement for the namespace 2. When undoing an extraction, remove extracted resources from the resource file (if they were newly-created)
Great work! Thanks for the port to VS2010 of this excelent tool. Would be nice te have it integrated as an extension instead of an MSI but this looks like a more dificult task.
Hi,
I had the same issue and found a bug in the changes that were made in this version to get support for xaml. this had a side effect on c# code. to fix this, replace the line 419 of BaseHardCodedString.cs:
if (!reference.Equals(ns.NamespaceName) && reference.StartsWith(ns + ".") && ns.NamespaceName.Length > longestMatch.NamespaceName.Length)
by
if (!reference.Equals(ns.NamespaceName) && reference.StartsWith(ns + ".") && (longestMatch==null || ns.NamespaceName.Length > longestMatch.NamespaceName.Length))
longestMatch can be null at the beginning, which caused both preview and replace to not work
it looks like this still isn't fixed? aw maaaaaaaaaaaan! I was using this every day, and after rebuilding my machine, this version doesn't work anymore...
I've built a patch for this issue (31483). It also includes some enhancements/fixes to the UI which I wanted:
http://resourcerefactor2010.codeplex.com/SourceControl/list/patches
Hi!
Congratulations to this great VS extension!
I've got two feature requests:
- Provide an option to add new resource token to all culture-specific resource files with initial text
- Possibility to provide a template for XAML as sometimes wrappers are used (http://timheuer.com/blog/archive/2009/08/26/silverlight-string-localization.aspx)
Regards
Holger
Donny can you upload the VSIX file directly to Visual Studio Gallery? That way the tool can be installed directly from inside Visual Studio 2010.
Thanks!
Steven
Hey this looks like a great tool. XAML support needed urgently! Could you implement that?
Seeing as, in a WPF or Silverlight application, no-one wants to set all the strings in code.
It would be greatly appreciated.
Or, if its not too hard, I could contribute that myself...
According to this page http://msdn.microsoft.com/en-us/library/dd393694(VS.100).aspx Add-Ins cannot be installed using VSIX.
In case you have an idea how to deploy this project via VSIX contact me. You can download source code from http://dzonny.cz/Portals/0/SW/ResourceRefactor.src.rar.
Hi Donny,
Thanks for porting this to VS 2010. I was one of the developers who worked on this tool originally, it is nice to see there is active interest on this still.
I was actually also working on rewriting some parts of it for VS 2010 so that instead of an add-in it worked as an editor extension. This would also mean that it can be deployed with VSIX now. Hopefully I will be able to release it very soon.
Hi support for XAML makes usage of some xaml tags not supported by Silverlight. I made some changes to implement a replacement string that is compatible with silverlight projects. If some interested, just contact me
This didn't seem to work for me in razor. The context menu doesn't have the context menu and the Refactor menu option just produces an error "This project or file is not supported for resource refactoring. (HTML)"
I'm not surprised. This only works for supported file types. To be honnest I have never seen any .cshtml file myself :-(. If the Razor plugin is implemented in some nice way chances are that it'd be easy to add support for it.
Feel free to download source code from here: http://dzonny.cz/Software/Blog/tabid/93/EntryID/43/language/cs-CZ/Default.aspx and contribute Razor support :-).
Hi
Great tool. Only gripe I have is that the preview changes dialog does not preview all the lines that will change. The dialog disappears when I choose a file from the treeview. This is a bit of an irritation when you'd like to preview all changes across multiple files in your solution/project.
I'm using VS2010 on Win 7 (x64)
Thanks
I have VS2010 and VS2008 installed on the same machine. While this addin works just fine in VS2010, VS2008 gives me the following error when it tries to load the addin (version 2.1):
The Add-in 'Resource Refactoring Tool' failed to load or caused an exception.
Would you like to remove this Add-in?
If you choose yes, the file it was loaded from, 'C:\Users\YourName\AppData\Roaming\Microsoft\MSEnvShared\Addins\ResourceRefactor.AddIn', will be renamed.
Error Message: <Unknown Error>
Error number: 8013101b
Maybe the reason is that it was compiled against .NET Framework 4.0?
This appears to be a great tool. However the first thing I ran into is it will not select an existing resource file. I already have strings defined, and want to add to them. Is there a way to do that?
hi, I have installed this great tool already, but in my VS2010 and VS2008 I can't see the option in my menu.
I had executed "devenv.exe /resetaddin Microsoft.VSPowerToys.ResourceRefactor.Connect", but the option still disappeared.
Not only me got this problem, my friend has the same situation.
Our VS2010 are both Chinese version. I don't know if non-English version of Visual Stuido all have this problem.
Thanks for your sharing and I will appreciate your help.