diff --git a/metadata/dbms/editrecord.js b/metadata/dbms/editrecord.js index 9d883ba..782f606 100644 --- a/metadata/dbms/editrecord.js +++ b/metadata/dbms/editrecord.js @@ -139,8 +139,8 @@ class EdtRec str+=' '; str+=' '; str+=' '; - str+=' '+_('Name')+''; - str+=' '+_('Value')+''; + str+=' '+trt('Name')+''; + str+=' '+trt('Value')+''; str+=' '; str+=' '; str+=' '; @@ -379,11 +379,11 @@ class EdtRec select.appendChild( option ); option = document.createElement("option"); option.setAttribute("value","1"); - option.appendChild(document.createTextNode(_('Yes'))); + option.appendChild(document.createTextNode(trt('Yes'))); select.appendChild( option ); option = document.createElement("option"); option.setAttribute("value","0"); - option.appendChild(document.createTextNode(_('Not'))); + option.appendChild(document.createTextNode(trt('Not'))); select.appendChild( option ); }else { @@ -406,7 +406,7 @@ class EdtRec if(vt=="i4") { - //alert2(_('Alert'),"prop name = "+nodeProp.getAttribute("n")); + //alert2(trt('Alert'),"prop name = "+nodeProp.getAttribute("n")); //If there is a node "list" with the elements "CheckBox" then create them. var opt=findNode(nodeProp, "options"); @@ -456,7 +456,7 @@ class EdtRec button.className='button-secondary'; button.setAttribute("type","button"); button.setAttribute("value","+"); - button.setAttribute("title",_("Increase_by_1")); + button.setAttribute("title",trt("Increase_by_1")); button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;"; button.onclick=function(inp){return function(){inp.value=getIntVal(inp.value)+1;}}(input); @@ -466,7 +466,7 @@ class EdtRec button.className='button-secondary'; button.setAttribute("type","button"); button.setAttribute("value","-"); - button.setAttribute("title",_("Decrease_by_1")); + button.setAttribute("title",trt("Decrease_by_1")); button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;"; button.onclick=function(inp){return function(){inp.value=getIntVal(inp.value)-1;}}(input); newCell3.appendChild( button ); @@ -657,7 +657,7 @@ class EdtRec btnSel.className='button-secondary'; btnSel.setAttribute("type","button"); btnSel.setAttribute("value","..."); - btnSel.setAttribute("title",_('Upload')); + btnSel.setAttribute("title",trt('Upload')); btnSel.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;"; newCell2.appendChild(btnSel); @@ -666,13 +666,13 @@ class EdtRec button2.className='button-secondary'; button2.setAttribute("type","button"); button2.setAttribute("value","X"); - button2.setAttribute("title",_('Delete')); + button2.setAttribute("title",trt('Delete')); button2.style.cssText="height:22px;width:22px;margin:0px;padding:0px;"; button2.onclick=function(inp,ifr){return function(){ inp.value=''; getIframeDocument(ifr).forms["form"].reset(); }}(input,ifr); newCell3.appendChild(button2); //Download button - newCell4.innerHTML='
' + newCell4.innerHTML='
' td2.appendChild( tbl_b ); @@ -768,7 +768,7 @@ class EdtRec var td = document.createElement('td'); td.style.cssText="padding: 5px; vertical-align: bottom;"; td.setAttribute("colspan", "2"); - if (this.record_id==-1) td.innerHTML=''; + if (this.record_id==-1) td.innerHTML=''; tr.appendChild(td); //var td = document.createElement('td'); td.setAttribute("align","right"); @@ -776,7 +776,7 @@ class EdtRec button.className='button-secondary'; button.setAttribute("type","button"); button.style.cssText="margin:0px;margin-right:1px;"; - button.setAttribute("value",_('Apply')); + button.setAttribute("value",trt('Apply')); button.onclick=function(thiz){ return function(){ thiz.sendData(); @@ -788,8 +788,8 @@ class EdtRec button.setAttribute("type","button"); button.className='button-secondary'; button.style.cssText="margin:0px;"; - button.setAttribute("value",_('Cancel')); - //button.onclick=function f_exit(this) { alert2(_('Alert'),this.win.div); } + button.setAttribute("value",trt('Cancel')); + //button.onclick=function f_exit(this) { alert2(trt('Alert'),this.win.div); } button.onclick=function(thiz){ return function(){thiz.win.Close();};}(this); td.appendChild( button ); tr.appendChild(td); @@ -798,13 +798,13 @@ class EdtRec //Height adjust the height of the page //this.win.div.style.width="400px" //this.win.div.style.height="100px" - //alert2(_('Alert'),document.documentElement.scrollTop) - //alert2(_('Alert'),document.documentElement.clientHeight) + //alert2(trt('Alert'),document.documentElement.scrollTop) + //alert2(trt('Alert'),document.documentElement.clientHeight) this.win.setHeight(eTable.offsetHeight+40); //this.win.div.style.height=(eTable.offsetHeight+40)+"px"; - //alert2(_('Alert'),this.win.div.style.width) - //alert2(_('Alert'),this.win.div.style.height) + //alert2(trt('Alert'),this.win.div.style.width) + //alert2(trt('Alert'),this.win.div.style.height) this.win.setCenter(); @@ -1115,7 +1115,7 @@ class EdtRec nodeProp=nodeProp.nextSibling; } - if(count==0) alert2(_('Alert'),_("No_results_were_found_for_your_search")); + if(count==0) alert2(trt('Alert'),trt("No_results_were_found_for_your_search")); else if(count==1) //1 item has been selected, fill in the field. { @@ -1153,7 +1153,7 @@ class EdtRec var win=new TWin(); win.BuildGUI(pageX-280,pageY-7); win.setContent(htmlString); - win.setCaption(document.createTextNode(_("Selection"))); + win.setCaption(document.createTextNode(trt("Selection"))); win.setParent(this.win); //win.obj=this } @@ -1161,10 +1161,10 @@ class EdtRec }; applyReq(req,fn,node,xmldoc,win) - { //alert2(_('Alert'),"erec XML=\n"+getXMLNodeSerialisation(node)); + { //alert2(trt('Alert'),"erec XML=\n"+getXMLNodeSerialisation(node)); if (fn==-1) { - alert2(_('Alert'),findFirstNode(node,'#cdata-section').nodeValue); + alert2(trt('Alert'),findFirstNode(node,'#cdata-section').nodeValue); //this.pBarCnt=0; this.hideProgressBar(); }else @@ -1204,7 +1204,7 @@ class EdtRec this.setData(node); }else { - alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" ); + alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" ); this.hideProgressBar(); } }; @@ -1230,7 +1230,7 @@ class EdtRec } }else { - alert2(_('Alert'),'Field "'+prop_id+'" not find!'); + alert2(trt('Alert'),'Field "'+prop_id+'" not find!'); } }; @@ -1242,7 +1242,7 @@ class EdtRec //filterName - filter name callFilterVal(typeName,name,value,htmlid,filterName) { - //alert2(_('Alert')," typeName="+typeName+" name="+name+" value="+value+" htmlid="+htmlid); + //alert2(trt('Alert')," typeName="+typeName+" name="+name+" value="+value+" htmlid="+htmlid); if(value!="") { var xml=''; @@ -1274,8 +1274,8 @@ class EdtRec { var nProps1=findFirstNode(node, 'properties') var nProps2=findFirstNode(this.nodeMetadata, 'properties') //Since the values came in abbreviated XML - if(nProps1==null){ alert2(_('Alert'),'Error, node='+getXMLNodeSerialisation(node)); return; } - if(nProps2==null){ alert2(_('Alert'),'Error, nodeMetadata='+getXMLNodeSerialisation(this.nodeMetadata)); return; } + if(nProps1==null){ alert2(trt('Alert'),'Error, node='+getXMLNodeSerialisation(node)); return; } + if(nProps2==null){ alert2(trt('Alert'),'Error, nodeMetadata='+getXMLNodeSerialisation(this.nodeMetadata)); return; } var nProp1=nProps1.firstChild while(nProp1!=null) { @@ -1406,7 +1406,7 @@ class EdtRec //Проверяю тип дпнных и заполненость полей if (!this.checkData(value,nodeProp.getAttribute("vt"),nodeProp.getAttribute("maybenull"))) { - alert2(_('Alert'),_("The_field_data_is_incorrect")+" \""+nodeProp.getAttribute("d")+"\"=\""+value+"\"!"); + alert2(trt('Alert'),trt("The_field_data_is_incorrect")+" \""+nodeProp.getAttribute("d")+"\"=\""+value+"\"!"); return; } s+=' \n'; @@ -1416,7 +1416,7 @@ class EdtRec s+=' \n'; s+='\n'; s+=''; - //alert2(_('Alert'),s); + //alert2(trt('Alert'),s); if(this.request.callServer(ScriptName,s,true)) { this.showProgressBar(); @@ -1451,7 +1451,7 @@ class EdtRec //inserting the selected record setPropVal(id,caption,prop_id) { - //alert2(_('Alert'),"id="+id+" caption="+caption+" prop_id="+prop_id) + //alert2(trt('Alert'),"id="+id+" caption="+caption+" prop_id="+prop_id) var prop=document.getElementById("prop_"+this.uid+"_"+prop_id); var propvis=document.getElementById("prop_"+this.uid+"_"+prop_id+"_visible"); if ((prop!=null)&&(propvis!=null)) @@ -1477,9 +1477,9 @@ class EdtRec let readd=document.getElementById("readd_"+this.uid); if(readd!==null && readd.checked){ - //if(!confirm(_("Successfully_added_data")+".\n"+_("Add_more")+"?")) this.win.Close(); + //if(!confirm(trt("Successfully_added_data")+".\n"+trt("Add_more")+"?")) this.win.Close(); - confirm2(_('Warning'),_("Successfully_added_data")+"
"+_("Add_more")+"?",null,function(thiz){return function(){thiz.win.Close();};}(this)); + confirm2(trt('Warning'),trt("Successfully_added_data")+"
"+trt("Add_more")+"?",null,function(thiz){return function(){thiz.win.Close();};}(this)); }else diff --git a/metadata/dbms/records.php b/metadata/dbms/records.php index 2ed014b..781a8dd 100644 --- a/metadata/dbms/records.php +++ b/metadata/dbms/records.php @@ -153,7 +153,7 @@ } //Функция для перевода текста без применения GetText - function __($text) + function trt($text) { global $db,$lng,$Schema; @@ -184,7 +184,7 @@ return $result; } - //Перевод для строки в которой встречаются подстроки вида: _('') + //Перевод для строки в которой встречаются подстроки вида: trt('') function parseGT($text) { $result=''; @@ -192,7 +192,7 @@ $from = 0; // Позиция поиска для итерации while (true) { - $pos1 = strpos($text, '_(', $from); + $pos1 = strpos($text, 'trt(', $from); if($pos1 !== false) { $from = $pos1+3; @@ -202,7 +202,7 @@ if($pos2 !== false) { $result.=substr($text, $cut, $pos1 - $cut ); - $result.=__(substr($text, $pos1+3, $pos2 - $pos1 - 3 )); + $result.=trt(substr($text, $pos1+3, $pos2 - $pos1 - 3 )); $cut=$pos2+2; $from = $pos2 + 2; } @@ -1150,7 +1150,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 +1197,7 @@ setFilter($f1,$f2);//заменить все значения первого фильтра значениями из второго //Выбираем параметры фильтра (Для информирования что было заполнено) - $filter=''._('Filter options').'
'; + $filter=''.trt('Filter options').'
'; $nextnode=$f1->firstChild; while ($nextnode) { if ($nextnode->nodeName=='column') @@ -1235,7 +1235,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 +1300,8 @@ fwrite($fh, ' '."\n"); fwrite($fh, ' '."\n"); - fwrite($fh, ''._('Time and date of generation').': '.date('H:i:s m.d.Y').'
'); - fwrite($fh, ''._('Creator').': '.$name); + fwrite($fh, ''.trt('Time and date of generation').': '.date('H:i:s m.d.Y').'
'); + fwrite($fh, ''.trt('Creator').': '.$name); fwrite($fh, $filter); fwrite($fh, ' '."\n"); @@ -1367,7 +1367,7 @@ //deleteTempFiles($dir); }else { - sendError(_('Not found the requested node:').' "'.$typename.'"!'); + sendError(trt('Not found the requested node:').' "'.$typename.'"!'); } }else diff --git a/metadata/tree/tree.js b/metadata/tree/tree.js index 33ec3e2..57f3304 100644 --- a/metadata/tree/tree.js +++ b/metadata/tree/tree.js @@ -151,18 +151,18 @@ function TMenu(v_obj,v_scr,v_treepath) //Горизонтальное меню //загрузился xml документ начинаем его разбирать (по id функции в документе) let xmldoc = xmlHttpRequest.responseXML; if(xmldoc==null){ - alert2(_('Alert'),_('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText); + alert2(trt('Alert'),trt('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText); return; } let node = xmldoc.documentElement; - //alert2(_('Alert'),"Данные=\n"+xmlHttpRequest.responseText); - if((node==null)||(node.getAttribute("fn")==null)) alert2(_('Alert'),_('Error')+"\n"+_('No_data')+"!\n"+xmlHttpRequest.responseText); + //alert2(trt('Alert'),"Данные=\n"+xmlHttpRequest.responseText); + if((node==null)||(node.getAttribute("fn")==null)) alert2(trt('Alert'),trt('Error')+"\n"+trt('No_data')+"!\n"+xmlHttpRequest.responseText); else { var fn = node.getAttribute("fn"); if (fn=='0') { - alert2(_('Alert'),findFirstNode(node,"#cdata-section").nodeValue); + alert2(trt('Alert'),findFirstNode(node,"#cdata-section").nodeValue); }else if (fn=='1') { var tn=this.findNode(node.getAttribute("htmlid")); //Родительский узел @@ -183,11 +183,11 @@ function TMenu(v_obj,v_scr,v_treepath) //Горизонтальное меню var cnt=document.getElementById(this.m_pr+tn.htmlid+'tb'); if(cnt!=null) this.createList(tn.htmlid); //Создать HTML кнопки }else - alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" ); + alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" ); } }else { - alert2(_('Alert'),_('Failed_to_get_data')+"\n URL: "+url+"\n" + xmlHttpRequest.statusText); + alert2(trt('Alert'),trt('Failed_to_get_data')+"\n URL: "+url+"\n" + xmlHttpRequest.statusText); } } }; @@ -549,7 +549,7 @@ function TMenu(v_obj,v_scr,v_treepath) //Горизонтальное меню //Добавить слушателя нажатия на кнопку this.addListener=function(listener) - { if(listener.OnClickNode==null) alert2(_('Alert'),'У объекта нет функции "OnClickNode()"!'); + { if(listener.OnClickNode==null) alert2(trt('Alert'),'У объекта нет функции "OnClickNode()"!'); this.m_ls[this.m_ls.length]=listener; }; //Удалить слушателя @@ -651,28 +651,28 @@ function TTree(v_obj,v_pr,v_scr,v_pth,v_imgsize) //Дерево //загрузился xml документ начинаем его разбирать (по id функции в документе) let xmldoc = xmlHttpRequest.responseXML; if(xmldoc==null){ - alert2(_('Alert'),_('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText); + alert2(trt('Alert'),trt('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText); return; } let node = xmldoc.documentElement; - if((node==null)||(node.getAttribute("fn")==null)) alert2(_('Alert'),_('Error')+"\n"+_('No_data')+"!\n"+xmlHttpRequest.responseText); + if((node==null)||(node.getAttribute("fn")==null)) alert2(trt('Alert'),trt('Error')+"\n"+trt('No_data')+"!\n"+xmlHttpRequest.responseText); else { var fn = node.getAttribute("fn"); if (fn==0) { - alert2(_('Alert'),findFirstNode(node,"#cdata-section").nodeValue); + alert2(trt('Alert'),findFirstNode(node,"#cdata-section").nodeValue); }else if (fn==1) { this.addNode(node); this.OpenTreeOnPath(this.m_path); }else - alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" ); + alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" ); } }else { - alert2(_('Alert'),_('Failed_to_get_data')+"\n URL: "+url+"\n" + xmlHttpRequest.statusText); + alert2(trt('Alert'),trt('Failed_to_get_data')+"\n URL: "+url+"\n" + xmlHttpRequest.statusText); } } }; @@ -905,7 +905,7 @@ function TTree(v_obj,v_pr,v_scr,v_pth,v_imgsize) //Дерево //Добавить слушателя this.addListener=function(listener) - { if(listener.OnClickNode==null) alert2(_('Alert'),'У объекта нет функции "OnClickNode()"!'); + { if(listener.OnClickNode==null) alert2(trt('Alert'),'У объекта нет функции "OnClickNode()"!'); this.m_ls[this.m_ls.length]=listener; }; //Удалить слушателя @@ -917,7 +917,7 @@ function TTree(v_obj,v_pr,v_scr,v_pth,v_imgsize) //Дерево }; //Добавить слушателя this.addListenerLoad=function(listener) - { if(listener.OnLoadNode==null) alert2(_('Alert'),'У объекта нет функции "OnLoadNode(node)"!'); + { if(listener.OnLoadNode==null) alert2(trt('Alert'),'У объекта нет функции "OnLoadNode(node)"!'); this.m_lsl[this.m_lsl.length]=listener; }; //Удалить слушателя