Click here to Skip to main content
15,861,168 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

 
Generalwww.safedevelop.com - I am confused Pin
Uwe Keim18-Aug-07 10:12
sitebuilderUwe Keim18-Aug-07 10:12 
GeneralRe: www.safedevelop.com - I am confused Pin
Alexander Nesterenko19-Aug-07 22:47
Alexander Nesterenko19-Aug-07 22:47 
GeneralRe: www.safedevelop.com - I am confused Pin
Uwe Keim22-Aug-07 3:16
sitebuilderUwe Keim22-Aug-07 3:16 
GeneralRe: www.safedevelop.com - I am confused Pin
Alexander Nesterenko22-Aug-07 4:23
Alexander Nesterenko22-Aug-07 4:23 
GeneralRe: www.safedevelop.com - I am confused Pin
Alexander Nesterenko22-Aug-07 7:22
Alexander Nesterenko22-Aug-07 7:22 
GeneralRe: www.safedevelop.com - I am confused Pin
Uwe Keim22-Aug-07 10:18
sitebuilderUwe Keim22-Aug-07 10:18 
GeneralRe: www.safedevelop.com - I am confused Pin
Alexander Nesterenko22-Aug-07 22:25
Alexander Nesterenko22-Aug-07 22:25 
GeneralResharper dont see this plugin Pin
tecnic6-Aug-07 4:38
tecnic6-Aug-07 4:38 
GeneralRe: Resharper dont see this plugin Pin
Alexander Nesterenko7-Aug-07 22:36
Alexander Nesterenko7-Aug-07 22:36 
GeneralRe: Resharper dont see this plugin Pin
tecnic8-Aug-07 8:16
tecnic8-Aug-07 8:16 
GeneralRe: Resharper dont see this plugin Pin
Alexander Nesterenko8-Aug-07 19:58
Alexander Nesterenko8-Aug-07 19:58 
GeneralReSharper 3.0.2 Pin
Uwe Keim22-Jul-07 22:40
sitebuilderUwe Keim22-Jul-07 22:40 
GeneralRe: ReSharper 3.0.2 Pin
Alexander Nesterenko22-Jul-07 23:21
Alexander Nesterenko22-Jul-07 23:21 
GeneralRe: ReSharper 3.0.2 Pin
Uwe Keim22-Jul-07 23:24
sitebuilderUwe Keim22-Jul-07 23:24 
GeneralRe: ReSharper 3.0.2 Pin
Alexander Nesterenko22-Jul-07 23:30
Alexander Nesterenko22-Jul-07 23:30 
GeneralRe: ReSharper 3.0.2 Pin
Alexander Nesterenko22-Jul-07 23:31
Alexander Nesterenko22-Jul-07 23:31 
GeneralRe: ReSharper 3.0.2 Pin
Alexander Nesterenko22-Jul-07 23:37
Alexander Nesterenko22-Jul-07 23:37 
GeneralRe: ReSharper 3.0.2 Pin
Uwe Keim22-Jul-07 23:40
sitebuilderUwe Keim22-Jul-07 23:40 
GeneralRe: ReSharper 3.0.2 Pin
Alexander Nesterenko23-Jul-07 1:53
Alexander Nesterenko23-Jul-07 1:53 
GeneralRe: ReSharper 3.0.2 Pin
Uwe Keim23-Jul-07 1:54
sitebuilderUwe Keim23-Jul-07 1:54 
News[ANN] Version 0.9.23 for R# 3.0.1 is available Pin
Alexander Nesterenko9-Jul-07 22:49
Alexander Nesterenko9-Jul-07 22:49 
GeneralRe: [ANN] Version 0.9.23 for R# 3.0.1 is available Pin
Uwe Keim10-Jul-07 5:55
sitebuilderUwe Keim10-Jul-07 5:55 
Wonderful! You did miracles! From my first tests, working with strings in my large project just feels smoothly now.

Thank you very much, I feel free to post any issues that will occur during working with your great plug-in.

Thanks again.


--
Zeta Producer Desktop CMS
Intuitive, completely easy-to-use CMS for Windows.

Zeta Helpdesk
Open Source ticket software for Windows and web.

Zeta Uploader
Easily send large files by e-mail. Windows and web client.

Desargues
Innovative, lean and neat calculator for Windows.

GeneralRe: [ANN] Version 0.9.23 for R# 3.0.1 is available Pin
Alexander Nesterenko10-Jul-07 19:09
Alexander Nesterenko10-Jul-07 19:09 
News[ANN] New version for R# 3.0.1 is available Pin
Alexander Nesterenko7-Jul-07 4:05
Alexander Nesterenko7-Jul-07 4:05 
GeneralRe: [ANN] New version for R# 3.0.1 is available Pin
Uwe Keim7-Jul-07 23:08
sitebuilderUwe Keim7-Jul-07 23:08 

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.