/", $term, $matches ) ) die( "Can't find term name in '$term'\n" ); $assocTerms[$matches[1]] = $term; } foreach ( $enSLANG as $enName=>$enValue ) { if ( empty($SLANG[$enName]) ) { print( "Got missing token '".$enName."'\n" ); $termPaddLen = max( $termOffset-(2+strlen($enName)), 0 ); $commPaddLen = max( $commOffset-(2+strlen($enValue)), 0 ); $assocTerms[$enName] = " '".$enName."'".str_repeat(" ",$termPaddLen)."=> '$enValue', ".str_repeat(" ",$commPaddLen)."// Added - $modDate"; } } foreach ( $SLANG as $name=>$value ) { if ( empty($enSLANG[$name]) ) { print( "Got extraneous token '".$name."'\n" ); unset($assocTerms[$name]); } } ksort( $assocTerms, SORT_STRING ); $newCode = $fileParts[1].join( "\n", array_values($assocTerms) )."\n".rtrim($fileParts[3])."\n"; if ( $fp = fopen( $newFile, "w" ) ) { fwrite( $fp, $newCode ); fclose( $fp ); } rename( $newFile, $file ); } ?>