Changeset 12427 for trunk/include
- Timestamp:
- Oct 13, 2011, 8:00:53 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r11753 r12427 767 767 768 768 $regex = "~$ldq *\'([^'$]+)\'\|@translate *$rdq~"; 769 $source = preg_replace ( $regex.'e', 'isset($lang[\'$1\']) ? $lang[\'$1\'] : \'$0\'', $source);769 $source = preg_replace_callback( $regex, create_function('$m', 'global $lang; return isset($lang[$m[1]]) ? $lang[$m[1]] : $m[0];'), $source); 770 770 771 771 $regex = "~$ldq *\'([^'$]+)\'\|@translate\|~"; 772 $source = preg_replace ( $regex.'e', 'isset($lang[\'$1\']) ? \'{\'.var_export($lang[\'$1\'],true).\'|\' : \'$0\'', $source);772 $source = preg_replace_callback( $regex, create_function('$m', 'global $lang; return isset($lang[$m[1]]) ? \'{\'.var_export($lang[$m[1]],true).\'|\' : \'$m[0]\';'), $source); 773 773 774 774 $regex = "~($ldq *assign +var=.+ +value=)\'([^'$]+)\'\|@translate~e"; 775 $source = preg_replace ( $regex, 'isset($lang[\'$2\']) ? \'$1\'.var_export($lang[\'$2\'],true) : \'$0\'', $source);775 $source = preg_replace_callback( $regex, create_function('$m', 'global $lang; return isset($lang[$m[2]]) ? $m[1].var_export($lang[$m[2]],true) : \'$m[0]\';'), $source); 776 776 777 777 return $source;
Note: See TracChangeset
for help on using the changeset viewer.