<commit_before><?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     block.translate.php
 * Type:     block
 * Name:     translate
 * Purpose:  translate a block of text
 * -------------------------------------------------------------
 */
 
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER['SCRIPT_NAME'],basename(__FILE__)) !== false) {
  header('location: index.php');
  exit;
}

include_once('lib/init/tra.php');

function smarty_block_tr($params, $content, &$smarty) {
	if (empty($content) )
		return;
	if (empty($params['lang'])) {
		$lang = '';
	} else {
		$lang = $params['lang'];
	}
	echo tra($content,$lang);
}
?>
<commit_msg>[MOD] use return instead of echo<commit_after><?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     block.translate.php
 * Type:     block
 * Name:     translate
 * Purpose:  translate a block of text
 * -------------------------------------------------------------
 */
 
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER['SCRIPT_NAME'],basename(__FILE__)) !== false) {
  header('location: index.php');
  exit;
}

include_once('lib/init/tra.php');

function smarty_block_tr($params, $content, &$smarty) {
	if (empty($content) )
		return;
	if (empty($params['lang'])) {
		$lang = '';
	} else {
		$lang = $params['lang'];
	}
	return tra($content,$lang);
}
?>

{'fraction_non_alphanumeric': 0.3116185359301545, 'fraction_numerical': 0.0, 'mean_word_length': 1.9330708661417322, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1435953', 'n_tokens_mistral': 442, 'n_tokens_neox': 428, 'n_words': 107}