ReSharper 2017.1 Help

Coding Assistance for Localization

ReSharper provides a number features that help you work with resources in the editor:

Editing Resource Value

With the Edit Resource Value command that you can invoke for a resource usage in a code file or for a resource definition in a resource file, you can check and edit resource values for all cultures

To edit resource value

  1. Set the caret at the resource usage in a code file:
    /help/img/dotnet/2017.1/Resources__Refactorings__Move_Resource_01.png
    or at the resource name in a.resx file:
    /help/img/dotnet/2017.1/Resources__Refactorings__Move_Resource_03.png
  2. Do one of the following:
    • Press Alt+Enter and choose Edit resource value
    • In the main menu, choose ReSharper | Edit | Resource Value.
  3. In the Edit Resource dialog that appears, check the current value of the resource and define a new value if necessary.
    /help/img/dotnet/2017.1/Resources__Edit_Resource_Value_02.png
  4. Optionally, you can click Show comments to check the existing comment and modify it if necessary.
  5. If the resource is overridden in several cultures, you can navigate between them. To go to the resource value defined in another culture, use Previous culture and Next culture buttons on top of the dialog or click on the culture hyperlink and choose the desired culture.

Code Completion

ReSharper provides Code Completion (IntelliSense) features for resource usages in code files. Wherever resource usage is appropriate, ReSharper adds resource classes and resources into completion lists:

/help/img/dotnet/2017.1/Resources__Completion_01.png

Quick Documentation

The Quick Documentation works perfectly for resources. You can set the caret at the resource and press Ctrl+Q or choose ReSharper | Edit | Show Quick Documentation in the main menu to get the quick but thorough overview of the resource:

/help/img/dotnet/2017.1/Resources__Quick_Documentation_01.png

When working with resources, Quick Documentation is available for:

  • Resource definition in a .resx file
  • Resource usage in a C# or VB.NET code file
  • Resource usage in a XAML file

Context Actions

Move HTML to resource

This context action is available when you select text or a part of HTML code:

/help/img/dotnet/2017.1/Resources__Move_Html_to_Resource_01.png

After you choose this context action, the Select Resource File drop-down list opens, where you can choose a resource file to move the selected text or HTML code to. Whether resource files exist or not, ReSharper suggests you at least one local and one global resource file. If a resource file does not exist its name is written in italic; it will be created automatically if you choose it.
/help/img/dotnet/2017.1/Resources__Move_Html_to_Resource_02.png

After you choose a resource file, ReSharper replaces the selected text or HTML code with the resource usage and deploys a Hot Spot Session so that you could finish the definition. The resource key is proposed automatically and highlighted with a red frame; the input focus is set there.
/help/img/dotnet/2017.1/Resources__Move_Html_to_Resource_03.png
Accept the proposed value or type another resource key and then press Enter or Tab to finish the operation.

Last modified: 12 October 2017

See Also