Clean up tool maybe?

Hi Phil,

Working with your great tool over a longer period of time, our projects did change. Renaming/deleting files is not cleaned up by the tool. It will leave the mappings in the "mlp.xml" file and the resx files for each country will remain with same naming as well (rename destination will require rescan to work).

Real user story:

  1. CreateCustomer.aspx is created
  2. CreateCustomer_NEW.aspx is created to prepare a new UI and make it available for test for some customers
  3. CreateCustomer.aspx is renamed to CreateCustomer_OLD.aspx (and for a short period of time "OLD" will be available for customers not ready for the transition yet)
  4. CreateCustomer_NEW.aspx is renamed to CreateCustomer.aspx


The resx files is just waste of space and file count (takes more time to release). The mapping files on the other hand - they can mess up translations when above user story is executed. Let me elaborate.

Static text is converted into "LiteralResourceXXX" - The odds of having 2 LiteralResource with the same name in both "new" and "old" is almost 100% (e.g. LiteralResource1). The odds of "new" and "old" to have the same string of all colliting string IDs is minimal when the purpose of having 2 versions of the same page, was to change the contents. When I change my "NEW" to "current", it will use the mappings from "OLD".

I can imagine above wouldn't be an issue if I could either:

  1. Clean up the mappings file by clicking on an item in the "tool" menu
  2. Rescan and all mappings was cleaned up


Minor issues like removing multi-language from a file (ctrl+shift+space) and then renaming the file, will leave the record of the old filename to be ignored.. Adding a new file with the same filename (as the old filename) later, can make it difficult to understand why the file is not displaying (if you have the "hide ignored" filter activated).

----

My work around today (for any other users experiencing the same issues maybe), is to manually delete translation from files I want to rename or delete. So after deleting the file or renaming it, I go to App_LocalResources and delete the resx files. If I renamed the file, I go to the file and search for any resource id ( meta:resourcekey="\w*") and replace by empty string (). Then I search for LiteralResources (ID="LiteralResource) and replace with something different (ID="LitRes). This way I force the tool to generate new mappings.. But this is a (time consuming) hack.

Germany

I have just uploaded version 5.0x.0078.

I have added a new command to the tools menu to clean up the project database. This opens a wizard style dialog with three main steps (plus an info step at the beginning).

  • Handle components which have been removed or renamed
  • Handle controls which have been removed or renamed
  • Remove unused string IDs


In the first two cases, you can either delete the information, or specify that the component or control has been renamed. You can select the new name from a list.

The third case is basically identical to the previous dialog to remove unused String-IDs. (I might remove that dialog later.)

I have added a page to the help file for this dialog (and also for the new merge dialog).

I have mostly tested with Windows Forms projects, not ASP. I will try to do more testing in the next days. In principle, they are handled identically, but there might be some difference that I haven't thought of.smile

A 'double rename' as you describe (CreateCustomer.aspx to CreateCustomer_OLD.aspx and then CreateCustomer_NEW.aspx to CreateCustomer.aspx) is a difficult case, because the new clean-up dialog will not detect that CreateCustomer.aspx has been renamed. However, there is another way to handle this.

If you are using the Add-In, then it can detect when a component is renamed. I have added code to handle this event and update the component name in the project database. However, this will only work if you open the Add-In and select the project. In your case, this would be the best way.

By the way, the new clean-up dialog is very similar to a dialog in my old VB6 Add-In. When I wrote the .NET Add-In, I decided that it was too complicated and only wrote the simpler dialog to remove unused string-IDs.

Phil


Good work!

Regarding removing unused string UI - I didn't see if you changed anything yet, but just remembered that removing unused strings in our company is very much related to if the string was ever translated.

Imagine doing some prototyping and when implementing the real thing, you make adjustments that removes a string before it is even translated the first time.

Also, some of the issues I reported with odd strings getting selected for localization without me selecting it, this would really help clean up this mess as well (of course I would prefer not to have the issue).

When we pay for a translation, we want to keep that string - just in case we need it in the future. Hope it makes sense. But this is a minor feature request!!


I just tested the new Clean Up Tool.. Well - it seems like it is working, but I really feel shaky about using it right now in the beginning. Hope the tool will win my trust by not cleaning up too much ;-)

Right now I have a list of thousands of "Missing Controls". And if it's really true I need to remove all those mappings, it's really great the tool are now able to do it.. BUT..

Right now I need to single delete each of the records by clicking the mouse. It took me 5 minutes to get from A to E with a constant clicking.. Oh yes - we have a lot that should be cleaned up..

Maybe you could implement delete multiple (selecting multiple is possible, but clicking delete just deletes the last selected item).


And the list of "found controls" could be sorted alphabetic - having hundreds of controls on a page, makes it difficult to find the correct control.

Another possible improvement would be to show original language for "Missing Control" (if that is possible?) and showing the current value of the "found controls". This way you might be able to detect a rename or something similar..