diff --git a/metadata/dbms/records.php b/metadata/dbms/records.php
index 26274a5..c913ef5 100644
--- a/metadata/dbms/records.php
+++ b/metadata/dbms/records.php
@@ -153,8 +153,9 @@
}
//Функция для перевода текста без применения GetText
- function trt($text)
- {
+ /*
+ закоментил так как есть в tools.php
+ function trt($text) {
global $db,$lng,$Schema;
$language_id=1;
@@ -182,29 +183,32 @@
$result=str_replace("_", " ", $text);
}
return $result;
- }
+ }*/
- //Перевод для строки в которой встречаются подстроки вида: _('')
+ //Перевод для строки в которой встречаются подстроки вида: trt('')
function parseGT($text)
{
$result='';
+ $pLen=4; //Длина преамбулы trt(
$cut=0;
$from = 0; // Позиция поиска для итерации
while (true)
{
- $pos1 = strpos($text, '_(', $from);
+ $pos1 = strpos($text, 'trt(', $from);
if($pos1 !== false)
{
- $from = $pos1+3;
+ $from = $pos1+$pLen+1;
$pos2 = false;
- if($text[$pos1+2] == '"') $pos2 = strpos($text, '")', $from);
- if($text[$pos1+2] == '\'') $pos2 = strpos($text, '\')', $from);
+ if($text[$pos1+$pLen] == '"') $pos2 = strpos($text, '")', $from);
+ if($text[$pos1+$pLen] == '\'') $pos2 = strpos($text, '\')', $from);
if($pos2 !== false)
{
$result.=substr($text, $cut, $pos1 - $cut );
- $result.=trt(substr($text, $pos1+3, $pos2 - $pos1 - 3 ));
+ $result.=__(substr($text, $pos1+3, $pos2 - $pos1 - 3 ));
+ $toTranslate=substr($text, $pos1+$pLen+1, $pos2 - $pos1 - $pLen-1 );
+ $result.=trt($toTranslate);
$cut=$pos2+2;
- $from = $pos2 + 2;
+ $from = $pos2 + $pLen;
}
}else break;
}
@@ -1150,7 +1154,7 @@
if ($fn==8)//Получить отчёт как Excel.xls файл (почти тоже самое что и функция 4)
{
session_write_close(); //Разблокируем сессионный файл так как запросы могут быть достаточно долгими
- //if (!isset($_SESSION['USER_ID']) || $_SESSION['USER_ID']=='') sendError(_('You are not logged in!'));
+ //if (!isset($_SESSION['USER_ID']) || $_SESSION['USER_ID']=='') sendError(trt('You are not logged in!'));
//Выбираем информацию о текущем пользователе
$name='';
@@ -1197,7 +1201,7 @@
setFilter($f1,$f2);//заменить все значения первого фильтра значениями из второго
//Выбираем параметры фильтра (Для информирования что было заполнено)
- $filter=''._('Filter options').'
';
+ $filter=''.trt('Filter options').'
';
$nextnode=$f1->firstChild;
while ($nextnode)
{ if ($nextnode->nodeName=='column')
@@ -1235,7 +1239,7 @@
} catch (Exception $e)
{ sendError($e->getMessage());
}
- if($res->rowCount()!=1) sendError(_('The number of records is not equal to one!').' '.$sql_query);
+ if($res->rowCount()!=1) sendError(trt('The number of records is not equal to one!').' '.$sql_query);
$columns=explode(",",$nextnode->getAttribute('FieldCaption'));
@@ -1300,8 +1304,8 @@
fwrite($fh, ' '."\n");
fwrite($fh, '