gettext js

This commit is contained in:
2020-08-13 23:29:29 +06:00
parent e56556f8d4
commit 643b6850df
4 changed files with 51 additions and 51 deletions

View File

@ -61,7 +61,7 @@ class DBMSUser
{ {
if(findNode(node,'#cdata-section').nodeValue=="0") //if not logged if(findNode(node,'#cdata-section').nodeValue=="0") //if not logged
{ {
alert(_('Invalid_username_and_or_password')); alert(trt('Invalid_username_and_or_password'));
}else }else
{ {
//location.reload(); //location.reload();
@ -76,7 +76,7 @@ class DBMSUser
{ {
//if(findNode(node,'#cdata-section').nodeValue=="1") //if register //if(findNode(node,'#cdata-section').nodeValue=="1") //if register
//{ //{
// alert(_('New_user_is_registered')+'\n'+_('The_password_has_been_sent_to_you_by_Email')); // alert(trt('New_user_is_registered')+'\n'+trt('The_password_has_been_sent_to_you_by_Email'));
// location.reload(); // location.reload();
//} //}
} }
@ -91,7 +91,7 @@ class DBMSUser
{ {
this.win=new TWin(true); this.win=new TWin(true);
this.win.BuildGUI(10,10); this.win.BuildGUI(10,10);
this.win.setCaption(_('Authorization')); this.win.setCaption(trt('Authorization'));
this.win.setSize("350px","200px"); this.win.setSize("350px","200px");
@ -101,7 +101,7 @@ class DBMSUser
<tr><td>\n\ <tr><td>\n\
<table border="0" style="width: 100%; height: 100%;">\n\ <table border="0" style="width: 100%; height: 100%;">\n\
<tr>\n\ <tr>\n\
<td style="padding: 2px; width: 30%; white-space: nowrap"><b>'+_('Login')+' (E-mail):</b></td>\n\ <td style="padding: 2px; width: 30%; white-space: nowrap"><b>'+trt('Login')+' (E-mail):</b></td>\n\
<td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin'+this.uid+'" name="login"><br></td>\n\ <td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin'+this.uid+'" name="login"><br></td>\n\
</tr>\n\ </tr>\n\
<tr>\n\ <tr>\n\
@ -111,7 +111,7 @@ class DBMSUser
<tr>\n\ <tr>\n\
<td style="padding: 2px;" colspan="2"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%;"><tr><td><label for="save0" style="white-space: nowrap;"><input id="save_'+this.uid+'" type="checkbox" style="display: inline;" checked/>&nbsp;Remember&nbsp;(<a href="#" onclick="showRestoreForm();">Forgot your password?</a>)</label></td></tr></table></td>\n\ <td style="padding: 2px;" colspan="2"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%;"><tr><td><label for="save0" style="white-space: nowrap;"><input id="save_'+this.uid+'" type="checkbox" style="display: inline;" checked/>&nbsp;Remember&nbsp;(<a href="#" onclick="showRestoreForm();">Forgot your password?</a>)</label></td></tr></table></td>\n\
</tr>\n\ </tr>\n\
<tr><td colspan="2" style="text-align: right;"><input class="button-secondary" id="TLogin_E'+this.uid+'" type="button" style="display: inline;" value="'+_('Log_in')+'"></td></tr>\n\ <tr><td colspan="2" style="text-align: right;"><input class="button-secondary" id="TLogin_E'+this.uid+'" type="button" style="display: inline;" value="'+trt('Log_in')+'"></td></tr>\n\
</table>\n\ </table>\n\
</td></tr>\n\ </td></tr>\n\
</tbody>\n\ </tbody>\n\
@ -241,7 +241,7 @@ class DBMSUser
<tr><td>\n\ <tr><td>\n\
<table border="0" style="width: 100%; height: 100%;">\n\ <table border="0" style="width: 100%; height: 100%;">\n\
<tr>\n\ <tr>\n\
<td style="padding: 2px; width: 30%; white-space: nowrap"><b>'+_('Login')+' (E-mail):</b></td>\n\ <td style="padding: 2px; width: 30%; white-space: nowrap"><b>'+trt('Login')+' (E-mail):</b></td>\n\
<td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin'+this.uid+'" name="login"><br></td>\n\ <td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin'+this.uid+'" name="login"><br></td>\n\
</tr>\n\ </tr>\n\
<tr>\n\ <tr>\n\
@ -251,7 +251,7 @@ class DBMSUser
<tr>\n\ <tr>\n\
<td style="padding: 2px;" colspan="2"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%;"><tr><td><label for="save0" style="white-space: nowrap;"><input id="save_'+this.uid+'" type="checkbox" style="display: inline;" checked/>&nbsp;Remember&nbsp;(<a href="#" onclick="showRestoreForm();">Forgot your password?</a>)</label></td></tr></table></td>\n\ <td style="padding: 2px;" colspan="2"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%;"><tr><td><label for="save0" style="white-space: nowrap;"><input id="save_'+this.uid+'" type="checkbox" style="display: inline;" checked/>&nbsp;Remember&nbsp;(<a href="#" onclick="showRestoreForm();">Forgot your password?</a>)</label></td></tr></table></td>\n\
</tr>\n\ </tr>\n\
<tr><td colspan="2" style="text-align: right;"><input class="button-secondary" id="TLogin_E'+this.uid+'" type="button" style="display: inline;" value="'+_('Log_in')+'"></td></tr>\n\ <tr><td colspan="2" style="text-align: right;"><input class="button-secondary" id="TLogin_E'+this.uid+'" type="button" style="display: inline;" value="'+trt('Log_in')+'"></td></tr>\n\
</table>\n\ </table>\n\
</td></tr>\n\ </td></tr>\n\
</tbody>\n\ </tbody>\n\
@ -281,7 +281,7 @@ class DBMSUser
var password=document.getElementById('tcPassword'+this.uid).value; var password=document.getElementById('tcPassword'+this.uid).value;
if(login=='' || password=='') if(login=='' || password=='')
{ str="Not filled in the required fields: "; { str="Not filled in the required fields: ";
if(login=='') str+='"'+_('Login')+' (E-mail)"'; if(login=='') str+='"'+trt('Login')+' (E-mail)"';
if(login=='' && password=='') str+=', '; if(login=='' && password=='') str+=', ';
if(password=='') str+='"Password"'; if(password=='') str+='"Password"';
str+='!'; str+='!';
@ -434,16 +434,16 @@ function showRestoreForm()
{ {
var win=new TWin(true); var win=new TWin(true);
win.BuildGUI(10,10); win.BuildGUI(10,10);
win.setCaption(_("Password_recovery")); win.setCaption(trt("Password_recovery"));
str='<div id="TWin_DT_'+win.tWinId+'" style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\ str='<div id="TWin_DT_'+win.tWinId+'" style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; padding: 0px;">\n\ <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; padding: 0px;">\n\
<tr>\n\ <tr>\n\
<td style="padding: 2px; white-space: nowrap"><b>'+_('Login')+' (E-mail)</b></td>\n\ <td style="padding: 2px; white-space: nowrap"><b>'+trt('Login')+' (E-mail)</b></td>\n\
<td style="padding: 2px;"><input type="text" maxlength="40" style="width: 100%; display: inline;" id="'+win.uid+'_email" name="login">\n\ <td style="padding: 2px;"><input type="text" maxlength="40" style="width: 100%; display: inline;" id="'+win.uid+'_email" name="login">\n\
<table id="'+win.uid+'_phone" style="width: 100%; display: none;" cellpadding="0" cellspacing="0"><tr><td style="white-space: nowrap;"><b>+7 ( </b><input type="text" maxlength="3" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" style="width: 35px; display: inline;" id="'+win.uid+'_phone0" value=""><b> ) </b></td><td style="width: 90%;"><input type="text" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" maxlength="7" style="width: 100%;display: inline;" id="'+win.uid+'_phone1" value=""></td></tr></table><br></td>\n\ <table id="'+win.uid+'_phone" style="width: 100%; display: none;" cellpadding="0" cellspacing="0"><tr><td style="white-space: nowrap;"><b>+7 ( </b><input type="text" maxlength="3" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" style="width: 35px; display: inline;" id="'+win.uid+'_phone0" value=""><b> ) </b></td><td style="width: 90%;"><input type="text" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" maxlength="7" style="width: 100%;display: inline;" id="'+win.uid+'_phone1" value=""></td></tr></table><br></td>\n\
</tr>\n\ </tr>\n\
<tr><td colspan="2" style="text-align: right; padding: 2px;"><input class="button-secondary" id="'+win.uid+'_restore" type="button" style="display: inline;" value="'+_('Restore')+'"></td></tr>\n\ <tr><td colspan="2" style="text-align: right; padding: 2px;"><input class="button-secondary" id="'+win.uid+'_restore" type="button" style="display: inline;" value="'+trt('Restore')+'"></td></tr>\n\
</table>\n\ </table>\n\
</td></tr>\n\ </td></tr>\n\
</div>'; </div>';
@ -471,8 +471,8 @@ function showRestoreForm()
var em=document.getElementById(win.uid+'_email').value; var em=document.getElementById(win.uid+'_email').value;
if(em==''){ document.getElementById(win.uid+'_email').select(); alert(_('Not_filled_Email_address')); win.hideProgressBar(); return; } if(em==''){ document.getElementById(win.uid+'_email').select(); alert(trt('Not_filled_Email_address')); win.hideProgressBar(); return; }
if(! isEmail(em)){ document.getElementById(win.uid+'_email').select(); alert(_('Please_enter_a_valid_email_address')); win.hideProgressBar(); return; } if(! isEmail(em)){ document.getElementById(win.uid+'_email').select(); alert(trt('Please_enter_a_valid_email_address')); win.hideProgressBar(); return; }
//Send AJAX reqwest to server //Send AJAX reqwest to server
var xml='<?xml version="1.0" encoding="utf-8"?>\ var xml='<?xml version="1.0" encoding="utf-8"?>\
@ -495,12 +495,12 @@ function showRestoreForm()
//загрузился xml документ начинаем его разбирать (по id функции в документе) //загрузился xml документ начинаем его разбирать (по id функции в документе)
var xmldoc = xmlHttpRequest.responseXML var xmldoc = xmlHttpRequest.responseXML
if(xmldoc==null) { if(xmldoc==null) {
alert2(_('Alert'), _('Wrong_XML_document') + "!\n" + xmlHttpRequest.responseText); alert2(trt('Alert'), trt('Wrong_XML_document') + "!\n" + xmlHttpRequest.responseText);
return; return;
} }
var node = xmldoc.documentElement; var node = xmldoc.documentElement;
if((node==null)||(node.getAttribute("fn")==null)) alert(_('Error')+"\n "+_("No_data")+"!\n"+xmlHttpRequest.responseText); if((node==null)||(node.getAttribute("fn")==null)) alert(trt('Error')+"\n "+trt("No_data")+"!\n"+xmlHttpRequest.responseText);
else else
{ {
//alert("Принятый браузером XML=\n"+getXMLNodeSerialisation(node)); //alert("Принятый браузером XML=\n"+getXMLNodeSerialisation(node));
@ -518,7 +518,7 @@ function showRestoreForm()
} }
}else }else
{ {
if(confirm(_('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nRedo the request?")) if(confirm(trt('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nRedo the request?"))
{ {
var call=new myXMLHttpRequest(this); var call=new myXMLHttpRequest(this);
call.callServer(url,xmlString); call.callServer(url,xmlString);

View File

@ -25,7 +25,7 @@ function CheckSession(path)
clearTimeout(this.timer); clearTimeout(this.timer);
//alert('Ваша сессия завершилась!'); //alert('Ваша сессия завершилась!');
//location.reload(); //location.reload();
alert2(_("Alert"),'Ваша сессия завершилась! При нажатии на “OK” страница перезагрузится, а при нажатии на “X“ закроется сообщение.').onclick=function(){ location.reload(); }; alert2(trt("Alert"),'Ваша сессия завершилась! При нажатии на “OK” страница перезагрузится, а при нажатии на “X“ закроется сообщение.').onclick=function(){ location.reload(); };
} }
} }
} }

View File

@ -46,17 +46,17 @@ class SRec
applyReq(req,fn,node,xmldoc) applyReq(req,fn,node,xmldoc)
{ {
//alert2(_('Alert'),getXMLNodeSerialisation(node)); //alert2(trt('Alert'),getXMLNodeSerialisation(node));
this.hideProgressBar(); this.hideProgressBar();
this.xmldoc=node.ownerDocument; //xmldoc; this.xmldoc=node.ownerDocument; //xmldoc;
if (fn==-1) //Information menu if (fn==-1) //Information menu
{ {
alert2(_('Alert'),findFirstNode(node,'#cdata-section').nodeValue); alert2(trt('Alert'),findFirstNode(node,'#cdata-section').nodeValue);
}else }else
if (fn==0) if (fn==0)
{ {
//alert2(_('Alert'),getXMLNodeSerialisation(node)); //alert2(trt('Alert'),getXMLNodeSerialisation(node));
this.setMetadata(node); this.setMetadata(node);
this.updateSize(); this.updateSize();
}else }else
@ -81,10 +81,10 @@ class SRec
if(this.rwin!=null) if(this.rwin!=null)
{ {
this.rwin.hideProgressBar(); this.rwin.hideProgressBar();
this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: #f1f1f1;"><tr><td align="center"><a href="'+findFirstNode(node,'#cdata-section').nodeValue+'">'+_('Download_report')+': "'+this.win.getCaption().innerHTML+'".</a></td></tr></table>'); this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: #f1f1f1;"><tr><td align="center"><a href="'+findFirstNode(node,'#cdata-section').nodeValue+'">'+trt('Download_report')+': "'+this.win.getCaption().innerHTML+'".</a></td></tr></table>');
} }
}else }else
alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" ); alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" );
} }
//Edit the GUI filter from the xml string. //Edit the GUI filter from the xml string.
@ -150,11 +150,11 @@ class SRec
<caption></caption><thead></thead><tbody></tbody>\ <caption></caption><thead></thead><tbody></tbody>\
</table>\ </table>\
</td></tr><tr><td>\ </td></tr><tr><td>\
<table style="width:100%;"><tr><td><img src="../resources/metadata/dbms/images/rplus.png" alt="add" id="SRec_Add_'+this.uid+'" title="'+_('Add_record')+'" border="0" style="cursor: pointer;"/></td>\ <table style="width:100%;"><tr><td><img src="../resources/metadata/dbms/images/rplus.png" alt="add" id="SRec_Add_'+this.uid+'" title="'+trt('Add_record')+'" border="0" style="cursor: pointer;"/></td>\
<td><img src="../resources/metadata/dbms/images/rdel.png" alt="del" id="SRec_Del_'+this.uid+'" title="'+_('Delete_record')+'" border="0" style="cursor: pointer;"/></td>\ <td><img src="../resources/metadata/dbms/images/rdel.png" alt="del" id="SRec_Del_'+this.uid+'" title="'+trt('Delete_record')+'" border="0" style="cursor: pointer;"/></td>\
<td><img src="../resources/metadata/dbms/images/excel.png" alt="excel" id="SRec_Exc_'+this.uid+'" title="'+_('Export_to_Excel')+'" border="0" style="cursor: pointer;"/></td>\ <td><img src="../resources/metadata/dbms/images/excel.png" alt="excel" id="SRec_Exc_'+this.uid+'" title="'+trt('Export_to_Excel')+'" border="0" style="cursor: pointer;"/></td>\
<td style="width: 99%;">&nbsp;</td>\ <td style="width: 99%;">&nbsp;</td>\
<td><img src="../resources/metadata/dbms/images/refresh.png" alt="refresh" id="SRec_Rfr_'+this.uid+'" title="'+_('Update')+'" border="0" style="cursor: pointer;"/></td></tr>\ <td><img src="../resources/metadata/dbms/images/refresh.png" alt="refresh" id="SRec_Rfr_'+this.uid+'" title="'+trt('Update')+'" border="0" style="cursor: pointer;"/></td></tr>\
</table>\ </table>\
</td></tr><tr><td id="tblContainer_'+this.uid+'" style="vertical-align:top; overflow:hidden; width:100%; height:100%; text-align:center;">\ </td></tr><tr><td id="tblContainer_'+this.uid+'" style="vertical-align:top; overflow:hidden; width:100%; height:100%; text-align:center;">\
<div id="tblSContainer_'+this.uid+'" style="position: absolute; overflow:scroll; width: 400px; height: 400px;">\ <div id="tblSContainer_'+this.uid+'" style="position: absolute; overflow:scroll; width: 400px; height: 400px;">\
@ -234,7 +234,7 @@ class SRec
//Function to fill the drop-down lists (here it is necessary to ensure that everywhere there is a "var" in front of the variables). //Function to fill the drop-down lists (here it is necessary to ensure that everywhere there is a "var" in front of the variables).
setDataSelect(node) setDataSelect(node)
{ {
//alert2(_('Alert'),"setDataSelect = " + getXMLNodeSerialisation(node)); //alert2(trt('Alert'),"setDataSelect = " + getXMLNodeSerialisation(node));
let nodeType,prop_id,prop,option,nodeProp,id,value,cdataNode; let nodeType,prop_id,prop,option,nodeProp,id,value,cdataNode;
nodeType=findFirstNode(node, 'type'); nodeType=findFirstNode(node, 'type');
@ -247,7 +247,7 @@ class SRec
let nodeCur=findNodeOnAttribute(nodeFilter, 'column', 'n', prop_id); let nodeCur=findNodeOnAttribute(nodeFilter, 'column', 'n', prop_id);
if(nodeCur!=null) selector=nodeCur.getAttribute("selector"); if(nodeCur!=null) selector=nodeCur.getAttribute("selector");
//alert2(_('Alert'),"nodeCur = " + getXMLNodeSerialisation(nodeCur)); //alert2(trt('Alert'),"nodeCur = " + getXMLNodeSerialisation(nodeCur));
/*nodeCur=nodeFilter.firstChild /*nodeCur=nodeFilter.firstChild
while(nodeCur!=null) while(nodeCur!=null)
@ -324,7 +324,7 @@ class SRec
} }
if(count==0) if(count==0)
{ {
alert2(_('Alert'),_("No_results_were_found_for_your_search")); alert2(trt('Alert'),trt("No_results_were_found_for_your_search"));
}else }else
if(count==1) //fill without window if(count==1) //fill without window
{ {
@ -361,7 +361,7 @@ class SRec
win.BuildGUI(pageX-10,pageY-10); win.BuildGUI(pageX-10,pageY-10);
win.setHeight(400); win.setHeight(400);
win.setContent(htmlString); win.setContent(htmlString);
win.setCaption(document.createTextNode(_('Selection'))); win.setCaption(document.createTextNode(trt('Selection')));
win.setParent(this.win); win.setParent(this.win);
//win.obj=this //win.obj=this
} }
@ -401,7 +401,7 @@ class SRec
} }
}else }else
{ {
alert2(_('Alert'),'Filter "'+prop_id+'" not find!'); alert2(trt('Alert'),'Filter "'+prop_id+'" not find!');
} }
} }
@ -435,7 +435,7 @@ class SRec
columnNode = columnNode.nextSibling; columnNode = columnNode.nextSibling;
} }
} }
//alert2(_('Alert'),getXMLNodeSerialisation(this.nodeMetadata)); //alert2(trt('Alert'),getXMLNodeSerialisation(this.nodeMetadata));
} }
/** Function to send filter data to the server /** Function to send filter data to the server
@ -476,7 +476,7 @@ class SRec
xs+='</filter></objects-list></type>\n'; xs+='</filter></objects-list></type>\n';
xs+='</metadata>'; xs+='</metadata>';
//alert2(_('Alert'),xs); //alert2(trt('Alert'),xs);
if(this.request.callServer(ScriptName,xs)) if(this.request.callServer(ScriptName,xs))
{ {
@ -494,7 +494,7 @@ class SRec
let td,tr,td1,td2; let td,tr,td1,td2;
let nodeFilter=null; let nodeFilter=null;
let tablefilter=document.getElementById('idfilter'+this.uid); let tablefilter=document.getElementById('idfilter'+this.uid);
if (tablefilter.tBodies==null) alert2(_('Alert'),'tablefilter=null'); if (tablefilter.tBodies==null) alert2(trt('Alert'),'tablefilter=null');
let nodeType=findFirstNode(node, "type"); let nodeType=findFirstNode(node, "type");
this.f_pI=nodeType.getAttribute("ins");//access rights this.f_pI=nodeType.getAttribute("ins");//access rights
this.f_pU=nodeType.getAttribute("upd"); this.f_pU=nodeType.getAttribute("upd");
@ -679,12 +679,12 @@ class SRec
select.appendChild( option ); select.appendChild( option );
option=document.createElement("option"); option=document.createElement("option");
option.setAttribute("value","1"); option.setAttribute("value","1");
option.appendChild(document.createTextNode(_('Yes'))); option.appendChild(document.createTextNode(trt('Yes')));
if(value=="1") option.selected=true; if(value=="1") option.selected=true;
select.appendChild( option ); select.appendChild( option );
option=document.createElement("option"); option=document.createElement("option");
option.setAttribute("value","0"); option.setAttribute("value","0");
option.appendChild(document.createTextNode(_('Not'))); option.appendChild(document.createTextNode(trt('Not')));
if(value=="0") option.selected=true; if(value=="0") option.selected=true;
select.appendChild( option ); select.appendChild( option );
}else }else
@ -893,7 +893,7 @@ class SRec
} }
td2.appendChild( table ); td2.appendChild( table );
}else alert2(_('Alert'),"Unknown type = "+columnNode.getAttribute("vt")); }else alert2(trt('Alert'),"Unknown type = "+columnNode.getAttribute("vt"));
tablefilter.tBodies[0].appendChild(tr); tablefilter.tBodies[0].appendChild(tr);
} }
columnNode = columnNode.nextSibling; columnNode = columnNode.nextSibling;
@ -909,7 +909,7 @@ class SRec
let button = document.createElement('input'); let button = document.createElement('input');
button.className='button-secondary'; button.className='button-secondary';
button.setAttribute("type","button"); button.setAttribute("type","button");
button.setAttribute("value",_("Filtering")); button.setAttribute("value",trt("Filtering"));
button.setAttribute("id","btnfilter_"+this.uid); button.setAttribute("id","btnfilter_"+this.uid);
button.onclick=function(obj){ button.onclick=function(obj){
return function() return function()
@ -1039,7 +1039,7 @@ class SRec
tr.appendChild(th); tr.appendChild(th);
th=document.createElement('th'); th=document.createElement('th');
th.appendChild( document.createTextNode('Del')); th.appendChild( document.createTextNode('Del'));
th.title = _('Invert_selection'); th.title = trt('Invert_selection');
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;'; th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; }; th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; };
th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; }; th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; };
@ -1435,7 +1435,7 @@ class SRec
dataalert() dataalert()
{ {
let error_msg=""; let error_msg="";
if (error_msg!="") alert2(_('Alert'),"ShowRecords: \n"+error_msg); if (error_msg!="") alert2(trt('Alert'),"ShowRecords: \n"+error_msg);
} }
showreport(ext) showreport(ext)
@ -1446,8 +1446,8 @@ class SRec
this.rwin.BuildGUI(pageX-10,pageY-10); this.rwin.BuildGUI(pageX-10,pageY-10);
this.rwin.setParent(this.win); this.rwin.setParent(this.win);
this.rwin.setSize(280,130); this.rwin.setSize(280,130);
this.rwin.setCaption(_('Report')); this.rwin.setCaption(trt('Report'));
this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: #f1f1f1;"><tr><td align="center"><b>'+_('Preparing_of_report')+'</b></td></tr><tr><td align="center"><img src="./metadata/dbms/form/loading.gif" alt=""/></td></tr></table>'); this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: #f1f1f1;"><tr><td align="center"><b>'+trt('Preparing_of_report')+'</b></td></tr><tr><td align="center"><img src="./metadata/dbms/form/loading.gif" alt=""/></td></tr></table>');
this.appendFilter(); this.appendFilter();
//Call data from server //Call data from server
@ -1508,7 +1508,7 @@ class SRec
if(this.f_State=="1") //select one record if(this.f_State=="1") //select one record
{ {
//Send the id of the selected record to the parent of the selected record and close the window //Send the id of the selected record to the parent of the selected record and close the window
//alert2(_('Alert'),"id="+id+" f_PropName="+this.f_PropName+" f_TypeName="+this.f_TypeName); //alert2(trt('Alert'),"id="+id+" f_PropName="+this.f_PropName+" f_TypeName="+this.f_TypeName);
this.opener.setFilterObject(this.f_TypeName,this.f_PropName,id); this.opener.setFilterObject(this.f_TypeName,this.f_PropName,id);
this.win.Close(); this.win.Close();
}else }else
@ -1520,7 +1520,7 @@ class SRec
//We run through the marked records and request their removal //We run through the marked records and request their removal
deleteRecord(recordid) deleteRecord(recordid)
{ {
if (confirm(_("Are_you_sure_you_want_to_delete_the_entries")+'?')) if (confirm(trt("Are_you_sure_you_want_to_delete_the_entries")+'?'))
{ {
for(let i=0;i<this.masChBox.length;i++) for(let i=0;i<this.masChBox.length;i++)
{ {
@ -1602,7 +1602,7 @@ function nodeToTable(node)
if(cdataNode.nodeName=="#cdata-section") if(cdataNode.nodeName=="#cdata-section")
{ {
result[pos][cols[i]]=cdataNode.nodeValue; result[pos][cols[i]]=cdataNode.nodeValue;
//alert2(_('Alert'),pos+') '+cols[i]+' = '+cdataNode.nodeValue); //alert2(trt('Alert'),pos+') '+cols[i]+' = '+cdataNode.nodeValue);
i++; i++;
} }
cdataNode = cdataNode.nextSibling; cdataNode = cdataNode.nextSibling;

View File

@ -178,7 +178,7 @@ function alert2(title,text)
</tr>\n\ </tr>\n\
<tr style="height: 10px;">\n\ <tr style="height: 10px;">\n\
<td style="width: 100%;">&nbsp;</td>\n\ <td style="width: 100%;">&nbsp;</td>\n\
<td><button class="button-secondary" id="'+win.uid+'_close" style="width: 80px;">'+_('OK')+'</button></td>\n\ <td><button class="button-secondary" id="'+win.uid+'_close" style="width: 80px;">'+trt('OK')+'</button></td>\n\
</tr>\n\ </tr>\n\
</table>'; </table>';
@ -205,8 +205,8 @@ function confirm2(title,text,okFunc,cancelFunc)
</tr>\n\ </tr>\n\
<tr style="height: 10px;">\n\ <tr style="height: 10px;">\n\
<td style="width: 100%;">&nbsp;</td>\n\ <td style="width: 100%;">&nbsp;</td>\n\
<td><button class="button-secondary" id="'+win.uid+'_ok" style="width: 80px;">'+_('OK')+'</button></td>\n\ <td><button class="button-secondary" id="'+win.uid+'_ok" style="width: 80px;">'+trt('OK')+'</button></td>\n\
\<td><button class="button-secondary" id="'+win.uid+'_cancel" style="width: 80px;">'+_('Cancel')+'</button></td>\n\ \<td><button class="button-secondary" id="'+win.uid+'_cancel" style="width: 80px;">'+trt('Cancel')+'</button></td>\n\
</tr>\n\ </tr>\n\
</table>'; </table>';
@ -982,12 +982,12 @@ class TRequest
//загрузился xml документ начинаем его разбирать (по id функции в документе) //загрузился xml документ начинаем его разбирать (по id функции в документе)
var xmldoc = xmlHttpRequest.responseXML; var xmldoc = xmlHttpRequest.responseXML;
if(xmldoc==null){ if(xmldoc==null){
alert2(_('Alert'),_('Wrong_XML_document')+"!\nXML=("+xmlHttpRequest.responseText+')\nURL=('+url+')\nxmlString=('+xmlString+')'); alert2(trt('Alert'),trt('Wrong_XML_document')+"!\nXML=("+xmlHttpRequest.responseText+')\nURL=('+url+')\nxmlString=('+xmlString+')');
return; return;
} }
var node = xmldoc.documentElement; var node = xmldoc.documentElement;
if((node==null)||(node.getAttribute("fn")==null)) alert(_('Error')+"\n"+_('No_data')+"!\n"+xmlHttpRequest.responseText); if((node==null)||(node.getAttribute("fn")==null)) alert(trt('Error')+"\n"+trt('No_data')+"!\n"+xmlHttpRequest.responseText);
else else
{ {
//alert("XML=\n"+getXMLNodeSerialisation(node)); //alert("XML=\n"+getXMLNodeSerialisation(node));
@ -1006,7 +1006,7 @@ class TRequest
} }
}else }else
{ {
if(confirm(_('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nПовторить запрос?")) if(confirm(trt('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nПовторить запрос?"))
{ {
this.callServer(url,xmlString); this.callServer(url,xmlString);
}; };