Click here to Skip to main content
Click here to Skip to main content

Useful ReSharper plugin for localization

By , 26 Apr 2007
 

Introduction

This article describes plugin functions.

DT ReSharper Plugin roadmap

is available in the latest version
is partly available

  • Context actions
    • Move strings to resource
    • Replace string by property
    • Use System.String.Empty instead of ""
    • Use System.Environment.NewLine instead of "\r\n"
  • Highlighting
    • String literal is invalid
    • String could be moved to resource
    • String present in a resource
  • Refactoring
    • Move strings to resource
    • 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.

Replace string by property

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

Use System.String.Empty instead of ""

For empty strings use System.String.Empty.

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

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

Highlighting

String literal is invalid

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

An unrecognized escape sequence marked by red wave.

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".

All strings underlined by wavy line.

Refactoring

Move strings to resource

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

First, you select the resource file and string name.

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

Current string does not present in this list.

String placed to resource file after action.

and string literal replaced by property.

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)

About the Author

Alexander Nesterenko
Software Developer (Senior)
Belarus Belarus
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Generalwww.safedevelop.com - I am confusedsitebuilderUwe Keim18 Aug '07 - 10:12 
Just clicked on the Brinkster link to your website, just to found myself redirected to www.safedevelop.com [^].
 
I am confused - where is your greate product located now? Did you cancel the development process?
 
Thanks
Uwe
 
--
My personal 24/7 webcam

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.

GeneralRe: www.safedevelop.com - I am confusedmemberAlexander Nestrenko19 Aug '07 - 22:47 
The DT.ReSharper.Plugin renamed to the RGreatEx and moved to the www.safedevelop.com
GeneralRe: www.safedevelop.com - I am confusedsitebuilderUwe Keim22 Aug '07 - 3:16 
I see, thanks for your reply.
 
Sadly, the name "RGreatEx" is rather meaningless in context of what your plugin actually does. Something like "ReSharper StringResourcer Plugin" would be much more rememberable.
 
Any chance to get a version for 3.02, no that is has been released?
 
--
My personal 24/7 webcam

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.

GeneralRe: www.safedevelop.com - I am confusedmemberAlexander Nestrenko22 Aug '07 - 4:23 
RGreatEx - ReSharper Great Extension. Localization functions are basiс functionality in my great plans Smile | :)
GeneralRe: www.safedevelop.com - I am confusedmemberAlexander Nestrenko22 Aug '07 - 7:22 
>Any chance to get a version for 3.02, no that is has been released?
 
The RGreatEx 0.9.25 for the R# 3.0.2 is released today.
GeneralRe: www.safedevelop.com - I am confusedsitebuilderUwe Keim22 Aug '07 - 10:18 
Hi Alexander
 
Just installed version 0.9.25 on a ReSharper 3.0.2 (Build 3.0.515.4) but I do see NO plugins in ReSharper.
 
I even uninstalled any previous versions.
 
Any hints?
 
Thanks from Germany
Uwe
 
--
My personal 24/7 webcam

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.

GeneralRe: www.safedevelop.com - I am confusedmemberAlexander Nestrenko22 Aug '07 - 22:25 
The RGreatEx download page contains direct link to the required R# version. R# 3.0.2 have build 517.
GeneralResharper dont see this pluginmembertecnic6 Aug '07 - 4:38 
I have used VS 2008 beta 2 and Resharper 3.0.471.2. But my resharper dont see this plugin in the available plugings list.
How can I install this pluging?
 
Thanx.
GeneralRe: Resharper dont see this pluginmemberAlexander Nestrenko7 Aug '07 - 22:36 
Download new version from www.safedevelop.com and run with next command line arguments:
msiexec /i RGreatEx.Setup-0.9.24.msi VSVERSION=9.0
GeneralRe: Resharper dont see this pluginmembertecnic8 Aug '07 - 8:16 
Thank you very much.
GeneralRe: Resharper dont see this pluginmemberAlexander Nestrenko8 Aug '07 - 19:58 
You are welcome.
GeneralReSharper 3.0.2sitebuilderUwe Keim22 Jul '07 - 22:40 
To get rid of ASP.NET (erroneous) error messages, I need to upgrade to ReSharper 3.02.
 
I tried both a repair and complete reinstall of you software without success. The plug-in simply does not appear.
 
Do you hard-bind it to an exact version of ReSharper?
 
--
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: ReSharper 3.0.2memberAlexander Nestrenko22 Jul '07 - 23:21 
Last version 0.9.23 compiled for R# 3.0.1(3.0.471). You can fix this problem by assembly binding redirect.
GeneralRe: ReSharper 3.0.2sitebuilderUwe Keim22 Jul '07 - 23:24 
"assembly binding redirect" - Can you explain a little bit?
 
--
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: ReSharper 3.0.2memberAlexander Nestrenko22 Jul '07 - 23:30 
Use configuration file redirecting assembly binding for all used R# assemblies. Example from MSDN:









GeneralRe: ReSharper 3.0.2memberAlexander Nestrenko22 Jul '07 - 23:31 
Opps...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v1.0.3705">
<dependentAssembly>
<assemblyIdentity name="mscorcfg" publicKeyToken="b03f5f7f11d50a3a" culture=""/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="1.0.3300.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

GeneralRe: ReSharper 3.0.2memberAlexander Nestrenko22 Jul '07 - 23:37 
"ControlPanel->Administrative Tools->MS .NET 2.0 Configuration" is the simplest way to configure redirects.
GeneralRe: ReSharper 3.0.2sitebuilderUwe Keim22 Jul '07 - 23:40 
Thank you, I will try that.
 
--
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: ReSharper 3.0.2memberAlexander Nestrenko23 Jul '07 - 1:53 
Do you fix problem?
GeneralRe: ReSharper 3.0.2sitebuilderUwe Keim23 Jul '07 - 1:54 
No Smile | :) . For now I gave up, waiting for the final release.
 
--
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.

News[ANN] Version 0.9.23 for R# 3.0.1 is availablememberAlexander Nestrenko9 Jul '07 - 22:49 
1. Performance improved.
2. Bugs fixed.
GeneralRe: [ANN] Version 0.9.23 for R# 3.0.1 is availablesitebuilderUwe 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 availablememberAlexander Nestrenko10 Jul '07 - 19:09 
Thanks for your feedback. You are welcome.
News[ANN] New version for R# 3.0.1 is availablememberAlexander Nestrenko7 Jul '07 - 4:05 
Read more http://www40.brinkster.com/DeveloperTools/en/overview.html
GeneralRe: [ANN] New version for R# 3.0.1 is availablesitebuilderUwe Keim7 Jul '07 - 23:08 
Just downloaded and installed.
 
On small projects, the plug-in works very well.
 
Unfortunately on my current main project, activating the plug-in, the project gets unusable:
 
Whenever pressing a key inside a literal string, the CPU gets up to 100%, taking approx. 5-10 seconds to get the key printed in the editor. This happens for each key I press.
 
So I'm deactivating the plug-in for my large projects and only activating it again for smaller projects. Activating/deactivating results in ReSharper exception dialogs, though.
 
--
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] New version for R# 3.0.1 is availablememberAlexander Nestrenko8 Jul '07 - 19:22 
What is kind of your main project?
How many projects in current solution?
How many resource files in projects?
How many strings in resource files?
 
>So I'm deactivating the plug-in for my large projects and only activating it again for smaller >projects. Activating/deactivating results in ReSharper exception dialogs, though.
 
It's bug in R# API.
GeneralRe: [ANN] New version for R# 3.0.1 is availablesitebuilderUwe Keim8 Jul '07 - 19:39 
Thanks for your reply.
 
I have roughly:
 
- 8 projects
- ~1000 .cs files
- ~400 .resx files, including both global resources and Windows Forms resources. I do have language English and German files (.resx and .de.resx). So effectively, ~200 .resx files for English and ~200 .de.resx files for German
- I do have 6 global .resx files for English and 6 global .de.resx files for German
- These 6 global .resx files for English have approx. 900 string resources (i.e. another 900 in the German .de.resx files)
 
I know, probably a lot, but anyway, I need all of them Smile | :) .
 
--
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] New version for R# 3.0.1 is availablememberAlexander Nestrenko8 Jul '07 - 19:46 
Thanks for your answers. I will try to improve performance in next build.
GeneralRe: [ANN] New version for R# 3.0.1 is availablesitebuilderUwe Keim8 Jul '07 - 19:50 
Tell me, if I can help testing/improving/whatever, I would be more than glad to help!
 
--
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] New version for R# 3.0.1 is availablememberAlexander Nestrenko9 Jul '07 - 21:13 
Try to use new version.
GeneralSuggestionssitebuilderUwe Keim4 Jul '07 - 18:08 
The "Replace with String.Empty" should, in C#, replace with "string.Empty" rather than "String.Empty".
 
The "Move string to resource file" dialog should remember the last selected "Resource file" combo box value (per project).
 
When having your plug-in activated in large projects and/or CS files, it is nearly impossible to write literal strings, since each pressed key on the keyboard (when being inside a string "..." with the caret) usually stalls the VS.NET IDE for approx. 10 to 20 seconds, and a 50% CPU utilisation.
 
--
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.

AnswerRe: SuggestionsmemberAlexander Nestrenko4 Jul '07 - 19:21 
>The "Replace with String.Empty" should, in C#, replace with "string.Empty" rather than "String.Empty".
 
IMHO "string" is keyword, and call fields, properties, methods for keyword is wrong.
 
>The "Move string to resource file" dialog should remember the last selected "Resource file" combo box value (per project).
 
OK
 

GeneralRe: SuggestionssitebuilderUwe Keim4 Jul '07 - 19:49 
Alexander Nestrenko wrote:
The "Replace with String.Empty" should, in C#, replace with "string.Empty" rather than "String.Empty".
 
IMHO "string" is keyword, and call fields, properties, methods for keyword is wrong.

 
Never thought this way Smile | :) . When I see code from other persons using "String" instead of "string", I imply they are unaware of the C# concepts. Usually I am right with my assumption Wink | ;-) .

 
--
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.

AnswerRe: SuggestionsmemberAlexander Nestrenko4 Jul '07 - 23:09 
I can to add this case in the settings.
GeneralRe: SuggestionssitebuilderUwe Keim4 Jul '07 - 23:11 
Thank you, Alexander!
 
--
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.

General[ANN] Version 0.9.20 is availablememberAlexander Nestrenko21 Jun '07 - 23:46 
Use R#3.0 and supporting VB.NET
GeneralRe: [ANN] Version 0.9.20 is availablesitebuilderUwe Keim22 Jun '07 - 2:36 
http://www40.brinkster.com/DeveloperTools/en/overview.html [^] is down from my location.
 
Still the correct URL?
 
--
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.20 is availablememberAlexander Nestrenko22 Jun '07 - 2:42 
Try http://www40.brinkster.com/DeveloperTools/
News[ANN] Version 0.8.19 is availablememberAlexander Nestrenko12 Jun '07 - 21:40 
Read more http://www40.brinkster.com/DeveloperTools/en/overview.html
GeneralThank you!member_Daedius_8 Jun '07 - 17:36 
Thank you so much for this plug in! I can't tell you how much I love it Blush | :O
GeneralRe: Thank you!memberAlexander Nestrenko12 Jun '07 - 21:41 
Thank you for good words.
GeneralRe: Thank you!memberlexodus25 Jun '07 - 4:20 
Dito, thanks a lot!
News[ANN] Version 0.8.17 is availablememberAlexander Nestrenko28 May '07 - 23:50 
Added:
1. Supporting ASP.NET
2. Localization Options
AnswerRe: [ANN] Version 0.8.17 is availablememberAlexander Nestrenko28 May '07 - 23:51 
Sorry, Subject is incorrect. Version 0.8.18 is available Smile | :)
News[ANN] Version 0.8.17 is availablememberAlexander Nestrenko22 May '07 - 22:34 
http://www40.brinkster.com/DeveloperTools/en/Overview.html
News[ANN] Version 0.8.16 is availablememberAlexander Nestrenko18 May '07 - 2:04 
For more details see [^]http://www40.brinkster.com/DeveloperTools/en/overview.html[^]
GeneralPossible Issue: Line BreakssitebuilderUwe Keim14 May '07 - 17:57 
When placing multiline strings (with literal "\r\n" inside) with your plugin into resources, I discovered that when being displayed in a multiline text box, instead of line breaks, just a square is being displayed.
 
I guess this is because you simply place a "\n" whereas a textbox needs both "\r\n".
 
--
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.

AnswerRe: Possible Issue: Line BreaksmemberAlexander Nestrenko14 May '07 - 19:38 
I moves all literals to resource file without any changes. I can't с change string value, because it's break programm logic.
GeneralRe: Possible Issue: Line BreakssitebuilderUwe Keim14 May '07 - 20:00 
Oh, then it must be actually an issue inside the strings I move.
 
Sorry for bothering!
 
--
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.

News[ANN] Version 0.8.15 is availablememberAlexander Nestrenko14 May '07 - 5:37 
Fixed bugs an Added Refactoring methods:
 
1.Move Strings from File(s)...
2.Move Strings from Folder(s)...
3.Move Strings from Project...
 
For more details see http://www40.brinkster.com/DeveloperTools/en/overview.html [^]

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 27 Apr 2007
Article Copyright 2007 by Alexander Nesterenko
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid