Find all source hardcoded strings

I need to move all hardcoded strings to the source code in .resx files. Is there a tool that could help me find all hardcoded strings in C # code?

+58
c # visual-studio localization
Mar 22 '10 at 9:12
source share
6 answers

ReSharper 5 is an obvious choice, but many tips must be set to achieve your goals.

  • Include a broad analysis of solutions.
  • Go to ReSharper | Options | Code Inspection | Inspection Severity | Potential Code Quality Issues | Element is localizable set to Show as error .
  • Return to Solution Explorer and click on the project (csproj).
  • In the properties panel in the ReSharper category, set Localizable to Yes, Localizable Inspector to Pessimistic.

Then you can find almost everything you need in the "Error in the solution" panel.

Hope this helps.

+53
Mar 23 '10 at 3:52
source share
β€” -

You can always search for the " sign " in all .cs files. This should attract you to most of them, without much ado.

+3
Mar 22 '10 at 9:15
source share

This http://visuallocalizer.codeplex.com/ tool allows you to use batch transfers for resources along with other features. This is FOSS, maybe you can try. (I am participating)

+2
Apr 14 '13 at
source share

Resharper 5.0 (Beta) allows you to move lines to resources (it has a built-in localization function). Give it a try. Beta works fine, I use it every day and do not experience any problems. Best of all, it's free until beta. I even recommend using nightly builds as they seem stable.

Localization and globalization of software have always been tough and sometimes undesirable tasks for developers. ReSharper 5 greatly simplifies working with resources by providing a complete set of functions for resx files and resource use in C # and VB.NET code, as well as in ASP.NET and XAML markup.

Highlighted functions include moving a string to a resource, finding ways to use resources, and other navigation actions. In combination with refactoring support, checks and corrections, you get a convenient localization environment.

+1
Mar 22 '10 at 9:21
source share

Some of them are found by FxCop. Not sure what its limits are, I think it depends on the names of parameters and properties (for example: a property called "Text" is considered localized).

0
Mar 22 '10 at 9:37
source share

Or do a regular expression based search as described here:

https://vosseburchttechblog.azurewebsites.net/index.php/2014/12/16/find-all-string-literals-in-c-code-files-but-not-the-ones-in-comments/

 (?=(^((?!///).)*$)).*((".+?")|('.+?')).* 
0
Dec 19 '17 at 2:39 on
source share



All Articles