Quickly internationalize a .NET application

Skip to end of metadata
Go to start of metadata

Let’s say you want to quickly add multi-language support to your app, but don’t want to start messing with RESX files. Indeed, there is an easier way. Given the following code:

To move the string into a resource, move the caret over the string, open up the in-place refactoring menu (Ctrl+Shift+R) and choose Move to Resource:

Now, if you don’t have a resource file, ReSharper will warn you about it:

Making one is easy, though:

And now if you try to move a string to a resource, ReSharper will notice the newly created RESX file and offer to put the string into it:

Once you accept the above settings, the string will be added to the resource:

And, of course, your code will be changed to use the resource string:

  • No labels