Visual Studio - a tool for replacing hard-coded strings with resources

I have a large ASP.NET project full of hard-coded strings that now need to be extracted from resources. Such lines can be found almost anywhere (in .cs files, .aspx files, .ascx files, etc.), and the number of files is huge. What I'm looking for is a tool (or any way) to find all these hard-coded strings in one shot and combine them all together into a resource file, instead of having to manually run each file. Is there anything similar?

Note. I know that it would be better to immediately put the lines in the resources when they were needed for the first time, but this is a 2-year project where no one cared (a typical example is “not my problem”).

Many thanks.

The UPDATE . I tried CodeRush (I could not try RGreatEx for obvious reasons) and I am having difficulty using it. The main problem is that the lines I'm looking for are located mainly in .aspx files, and the lines in these files do not have the "Refactor to resource" command available.

For example, I may have elements like this:

<dxwgv:ASPxSummaryItem DisplayFormat="{0}" FieldName="TOTAL" ShowInColumn="Total" SummaryType="Sum" />

I need to change the ShowInColumn = "Total" part and make it like ShowInColumn = "<% $ Resources: PortalResource, Total%>". This is not a string assignment strictly, but an attribute assignment, so "Refactor!" CodeRush command does not appear.

- (, ) , . , ...

+3
7

VisualStudio RegEx. " ", .

.

+1
+3

VisualLocalizer CodePlex: VisualLocalizer. , - , .

+3
+1

RGreatEx. ReSharper:

RGreatEx - Visual Studio. .NET , 95% , . , " " " ". .

+1

ReSharper? , , 5.0. RGreatEx ( ). R # .

Refresh . The function will be in R # 5.0. See the official announcement .

+1
source

I just published a new tool called Jinnee.Package for refactoring strings. You can find it in the Visual Studio gallery: http://visualstudiogallery.msdn.microsoft.com/7ec5a225-dea4-47ae-8ebc-450d2980937f?SRC=Home

+1
source

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


All Articles