I need to move all the hard coded strings in my source code in .resx files. Is there a tool that could help me find all the hardcoded strings within C# code?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Or do a search based upon a regular expression like discussed here:
https://vosseburchttechblog.azurewebsites.net/index.php/2014/12/16/find-all-string-literals-in-c-code-files-but-not-the-ones-in-comments/
Some are found by FxCop. Not sure what its limits are, I think it depends on parameter and property names (eg: a property called "Text" is considered to be localized).
This tool http://visuallocalizer.codeplex.com/ allows for batch-move strings to resources, together with other features. It is FOSS so maybe you can give it a try. (I am involved)
You could always do a search for the
"
sign in all the .cs files. That should get you to most of them, without too much noise.ReSharper 5 is obvious a choice, but many tips must be set so as to achieve your goals,
ReSharper
|Options
|Code Inspection
|Inspection Severity
|Potential Code Quality Issues
|Element is localizable
set toShow as error
.Then you can find almost all you need in Errors in Solution panel.
Hope this helps.
Resharper 5.0 (Beta) allows you to move strings to resources (it has built in Localization feature). Give it a try. Beta works fine, i use it every day and have no problems. Best of all it's free until out of beta. I even recommend using night builds as they seem to be stable.