ReSharper Web Help

To move string to resource
  1. Place the caret at the string that should be localized:
    Move to Resource
  2. On the main menu, choose ReSharper | Refactor | Move or press F6. The Move to resource dialog box opens:
    Move to Resource
  3. Optionally, you can change name of the localizable string in the Name text box.
  4. Optionally, you can change the target resource file, select value in the Resource File drop-down list.
  5. Optionally, you can change value in the Value text area or add some text in the Comment text area.
  6. Optionally, you can specify where to search for the string by selecting the value in the Find identical items in drop-down list.
  7. Click Next to apply refactoring.

After applying the refactoring specified occurrences of the string are replaced with corresponding resource usages:
Move to Resource
New resource declaration appears in the .resx file:
Move to Resource

 Note

ReSharper can highlight the string and include the Move to resource refactoring in the drop-down list of quick-fixes, see Quick-Fixes for details.

 Note

ReSharper provides the same functionality for ValidationAttribute and its inheritors. Pay attention, that Access Modifier in .resx file should have Public value, otherwise, the refactoring will not be available.

See Also

Procedures