Task description
There is a project containing thousands of CPP sources that have to be localized into Chinese ASAP. We're using
gettext technique for localization and strings to be translated have to be wrapped with _(), for example:
::MessageBox( _("Translate me please"), _("Warning"), MB_OK)
We can run Visual Studio Find In Files->Current File for each file with the following regexp:
\".*\"
in order to search all strings, а then insert _('s and )'s.
But this is dull and boring, so let's switch on the brains and write a VisualBasic script in VBasic IDE (Alt-F11) which can be invoked by pressing F5 (or whatever you like, use Tools->Customize-Keyboard to setup hotkey).
Now just you have to traverse "Find Results" window by pressing F4 and optionally pressing F5 on each string that should be wrapped with _(). You can even avoid watching into .cpp source in simple cases with MessageBoxes (90% of strings). This way you reduce summary time of processing all the .cpp sources for at least thrice, and even five times.
Here is VBasic Script. Note that it even handles multiline strings!