3

I want to automate process of string localization.

Translations are stored in database.

The problem is, that to add a new localization entry, I need to complete folowing steps:

1) Open a file which stores constants with keys declaration. It looks like this :

public class LocalizationKeys
{
    public const string ui_btn_cancel = "ui_btn_cancel";

    public const string ui_btn_ok = "ui_btn_ok";
}

2) Open two sql script and add calls to stored procedures, like :

exec AddLocalization(...)

exec AddTranslation(...)

How to automate this routine, assuming I have resharper 6.1 installed in Visual Studio 2010? I thought about macros, but not sure this is a good idea. Idealy I want to select a string hit hotkey combination enter a key name and watch how computer doing its work.

v00d00
  • 3,215
  • 3
  • 32
  • 43

1 Answers1

2

ReSharper could certainly help you do that, but I'm afraid you'd need to write a small plug-in to so this. The idea would be that you would detect that the cursor is on a constant definition string literal, throw a pop-up box asking for the key, then you'd actually execute the sprocs directly from the plug-in with whatever ADO.NET/ORM you prefer.

If you do decide to go this route, you can download the ReSharper SDK here. Also, check out the plugin development guide.

Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166