<commit_before><?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     block.translate.php
 * Type:     block
 * Name:     translate
 * Purpose:  translate a block of text
 * -------------------------------------------------------------
 */
//global $lang;
//include_once('lang/language.php');
function smarty_block_tr($params, $content, &$smarty)
{
  global $lang_use_db;
  if ($lang_use_db!='y') {
    global $lang;
    if ($content) {
      if(isset($lang[$content])) {
        echo $lang[$content];  
      } else {
        echo $content;        
      }
    }
  } else {
    global $tikilib;
    global $language;
    $query="select `tran` from `tiki_language` where `source`=? and `lang`=?";
    $result=$tikilib->query($query,array($content,$language));
    $res=$result->fetchRow();<commit_msg>to have the user menu translated: TODO - to precompiled the user menus<commit_after><?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     block.translate.php
 * Type:     block
 * Name:     translate
 * Purpose:  translate a block of text
 * -------------------------------------------------------------
 */
function smarty_block_tr($params, $content, &$smarty)
{
  global $lang_use_db;
  if ($lang_use_db!='y') {
    if ($content) {
    global $language;
    global $lang;
    include_once("lang/$language/language.php");
      if(isset($lang[$content])) {
        echo $lang[$content];  
      } else {
        echo $content;        
      }
    }
  } else {
    global $tikilib;
    global $language;
    $query="select `tran` from `tiki_language` where `source`=? and `lang`=?";
    $result=$tikilib->query($query,array($content,$language));
    $res=$result->fetchRow();
{'fraction_non_alphanumeric': 0.27943661971830985, 'fraction_numerical': 0.0, 'mean_word_length': 1.7968503937007874, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4803446', 'n_tokens_mistral': 513, 'n_tokens_neox': 508, 'n_words': 112}