Click here to Skip to main content
15,860,859 members
Articles / Web Development / ASP.NET

Useful ReSharper plugin for localization

Rate me:
Please Sign up or sign in to vote.
4.94/5 (21 votes)
26 Apr 2007CPOL2 min read 204.1K   375   72   107
This ReSharper plugin contains features that helps you for localization

Image 2

Introduction

This article describes plugin functions.

DT ReSharper Plugin roadmap

Image 3 is available in the latest version
Image 4 is partly available

  • Context actions
    • Image 5 Move strings to resource
    • Image 6 Replace string by property
    • Image 7 Use System.String.Empty instead of ""
    • Image 8 Use System.Environment.NewLine instead of "\r\n"
  • Highlighting
    • Image 9 String literal is invalid
    • Image 10 String could be moved to resource
    • Image 11 String present in a resource
  • Refactoring
    • Image 12 Move strings to resource
    • Image 13 Move all strings from file(s) to resource
    • Move all strings from folder(s) to resource
    • Move all strings from project(s) to resource
    • Move all strings from solution to resource

Context actions

Move strings to resource

Move strings to resource by context action.

Image 14

Replace string by property

If a string exists in project resource files, then use "Replace string by property" context action.

Image 15

Use System.String.Empty instead of ""

For empty strings use System.String.Empty.

Image 16

Use System.Environment.NewLine instead of "\r\n"

For string that contains \r and \n, use System.Environment.NewLine.

Image 17

Highlighting

String literal is invalid

In the ReSharper -> Options you can set "Localization -> String literal is invalid" to "Show as error".

Image 18

An unrecognized escape sequence marked by red wave.

Image 19

String could be moved to resource

In the ReSharper -> Options you can set "Localization -> String literal could be moved to resource" to "Show as warning".

Image 20

All strings underlined by wavy line.

Image 21

Refactoring

Move strings to resource

You can move strings to resource by context action or main menu item.

Image 22

First, you select the resource file and string name.

Image 23

If the checkbox "Apply for all same strings in project {CurrentProjectName}" is true, then you can see all the same strings in this project.

Image 24

Image 25 Current string does not present in this list.

String placed to resource file after action.

Image 26

and string literal replaced by property.

Image 27

If checkbox "Keep modified files open" is true, then you can undo this action.

History

All changes

Visit DT ReSharper plugin homepage.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Belarus Belarus
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Is it working with asp pages? Pin
shlomiw1-May-07 22:34
shlomiw1-May-07 22:34 
Generalarticle title Pin
Robert Ensor1-May-07 12:12
Robert Ensor1-May-07 12:12 
AnswerRe: article title Pin
Alexander Nesterenko1-May-07 19:15
Alexander Nesterenko1-May-07 19:15 
QuestionSource Pin
Simone Busoli1-May-07 7:13
Simone Busoli1-May-07 7:13 
GeneralResharper Plugin Pin
h.eskandari30-Apr-07 20:42
h.eskandari30-Apr-07 20:42 
AnswerRe: Resharper Plugin Pin
Alexander Nesterenko1-May-07 19:16
Alexander Nesterenko1-May-07 19:16 
GeneralRe: Resharper Plugin Pin
h.eskandari1-May-07 20:39
h.eskandari1-May-07 20:39 
AnswerRe: Resharper Plugin Pin
Alexander Nesterenko1-May-07 20:54
Alexander Nesterenko1-May-07 20:54 
QuestionSource Please Pin
hatton30-Apr-07 15:22
hatton30-Apr-07 15:22 
QuestionRe: Source Please Pin
Andreas Kroll1-May-07 4:31
Andreas Kroll1-May-07 4:31 
AnswerRe: Source Please Pin
Alexander Nesterenko1-May-07 19:23
Alexander Nesterenko1-May-07 19:23 
AnswerRe: Source Please Pin
hatton1-May-07 21:21
hatton1-May-07 21:21 
GeneralRe: Source Please Pin
Alexander Nesterenko1-May-07 21:53
Alexander Nesterenko1-May-07 21:53 
AnswerRe: Source Please Pin
hatton1-May-07 22:06
hatton1-May-07 22:06 
GeneralRe: Source Please Pin
Alexander Nesterenko1-May-07 22:36
Alexander Nesterenko1-May-07 22:36 
GeneralRe: Source Please Pin
hatton2-May-07 3:21
hatton2-May-07 3:21 
QuestionWhat do you think about this plugin? Pin
Alexander Nesterenko28-Apr-07 0:02
Alexander Nesterenko28-Apr-07 0:02 
AnswerRe: What do you think about this plugin? Pin
Chris Maunder29-Apr-07 8:01
cofounderChris Maunder29-Apr-07 8:01 
AnswerRe: What do you think about this plugin? Pin
sting013-May-07 2:47
sting013-May-07 2:47 
QuestionWorks with ReSharper 3.0, too? Pin
Uwe Keim27-Apr-07 21:40
sitebuilderUwe Keim27-Apr-07 21:40 
AnswerRe: Works with ReSharper 3.0, too? Pin
Alexander Nesterenko27-Apr-07 23:52
Alexander Nesterenko27-Apr-07 23:52 
GeneralRe: Works with ReSharper 3.0, too? Pin
Uwe Keim27-Apr-07 23:56
sitebuilderUwe Keim27-Apr-07 23:56 
GeneralGreat plugin ... Pin
sting0127-Apr-07 1:01
sting0127-Apr-07 1:01 
GeneralRe: Great plugin ... Pin
Alexander Nesterenko27-Apr-07 1:06
Alexander Nesterenko27-Apr-07 1:06 
GeneralRe: Great plugin ... Pin
sting0127-Apr-07 1:12
sting0127-Apr-07 1:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.