I am working on a MOD to phpBB to integrate osCommerce and need all the language strings changed from the osCom format to the phpBB format.
I am wanting to write and expression to do the following but am having problems getting it to work: find code like this:
define('THIS_COULD_BE_ANYTHING', 'again anything');
and replace it with this
$lang['This_could_be_anything'] = 'again anything';
so that the first 'THIS_COULD_BE_ANYTHING' become capitalized.
Any pointers as to how to do this would be great - thanks. By the way - this is a great product, I use it at least once a week to update various files - searched through about 1000 files changing a couple of settings - fantastic ... well done.
This is very simple. We have to single out the two strings, the first one right after the opening bracket ending with the comma and the second one after the comma ending with the closing bracket.
Search expression
define\(\'([^\']+)\'\,\s+\'([^\']+)\'\)\;where
define\(\'matches startingdefine('([^\']+)matches everything until the first occurrence of single quote (end of the first string);\'\,\s+\'matches an ending quote, spaces and the starting quote:', '([^\']+)matches everything until the first occurrence of single quote (end of the second string);\'\)\;matches the end of the text:');Replace expression:
$lang['\u\L\1\E'] = '\2';where
\u- tells to make the next symbol uppercase;\L- forces further output lowercase, but\uoverrides it;\1- inserts stored text;\E- turns\Loff.
| © 2002-2006 | This help file was built with |