I collected my notes regarding techniques for global search and replace. As always, excercise caution and check carefully before committing. Sometimes a simple change must be made to all language versions of a file. Instead of asking every single language translation team to make the same repetitive edits, consider using a global search and replace.
If some text exists in multiple files and the same change must be made in several files, there are several ways to make these changes:
- Use a GUI text editor that can safely perform search and replace on many files containing UTF8 text
- Use a command line tool (described below) to make the changes. This option works well for more complex changes.
- Make the changes by hand to each file.
- Describe the change, and a programmer can use a tool to automate the changes. For example, the description below for "Zend_Inputfilter" => "Zend_Filter_Input" is good.
Next, either post a patch file or the command line used with a bug report (ticket), or test and commit to svn, if you have SVN commit permission for all the affected files and don't believe the issue should have its own bug report.
Create and test a needed global change on your local copy (commit your changes before testing, apply global search and replace, then "svn revert" can undo, if the changes cause any problems).
P.S. From Cygwin, I type:
The "sed" in Cygwin (http://www.gnu.org/software/sed/manual/html_mono/sed.html), does not claim to understand UTF8, which would lead to certain cases where this sed will produce undesirable results. Regardless, using a PHP replacement for sed that uses PCRE is just plain cool 8^).