Is there an easy way to find duplicate text in resource files in Visual Studio 2010

When considering the project I'm working on, I came across several places where the same text string appears in several resources (.resx).

I would like to see all such duplicates, because I believe that in most cases there is no reason for duplication (i.e. the text in question is used in the same context and should be transferred to or used from the resource file, accessible for all places that are necessary use for text).

Is there an easy way to identify such duplicates, either directly in Visual Studio, or using an add-in such as ReSharper?

Edit: I have to give an example of one of the situations that I have already found and fixed, so the problem is a bit clear. I found three instances of the Continue text string in the same project. Each instance had a different name (for example, name = "Continue", name = "Contnue" [sic] and name = "AdvanceToNextPage"). Two instances appeared in the same .resx file, one of which appeared in another .resx file, and since they were all in the same project, the text could (and possibly should) have been extracted from the record from the main Properties / Resources.resx file.

+4
source share
2 answers

Please refer to the following link for a quick and dirty XSLT that will go through the RESX file and print a list of duplicate resources by identifier along with a count of the number found:

http://www.paraesthesia.com/archive/2006/04/06/finding-duplicates-in-resx-using-xslt.aspx

0
source

You can use the Resx Resource Manager and select all files. You can then export them to Excel and let Excel find duplicates.

0
source

Source: https://habr.com/ru/post/1403914/


All Articles