NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Djordje Radovanovic on March 29, 2013, 04:01:32 AM
-
Is it possible to translate "Alert" title in PopUp window.
It would be ideal to make it as parameter to PopUp function (method).
Best regards,
Djordje Radovanovic
-
it goes through the translate method in the web handler. So you can put in one global translation there (rather than have to do it everytime.)
cheers
Bruce
-
Default is default, but sometimes you need to alter this default value.
> it goes through the translate method in the web handler
I am sure you are right but I don't know how.
best regards,
Djordje
-
The Web Handler procedure has a "Translate" embed where you can check the parameter string "p_string" for the "Alert" then place the translation into the "p_string" variable.
I hope this helps.
Rob Kolanko
-
Hi!
If I understand you right you can do some changing in netweb.js where you can find this function:
function ntAlert(m,t){
setTimeout(function() {
var a = jQuery(":focus");
$("#message_alert").remove();
if (t){
$('body').append('<div id="message_alert" title="' + t + '">' + m + '</div>'); ! YOU CAN CHANGE TITLE HERE
} else {
$('body').append('<div id="message_alert" title="Ошибка">' + m + '</div>'); ! AND HERE!
} [/b]
$("#message_alert").dialog({
resizable: false,
modal: true,
buttons: {
Ok: function() {
$(this).dialog("close");
$("#message_alert").remove();
}
}
});
jQuery(a).focus();
}, 1);
-
yes, and notice also that ntalert is called by the NetWebServerWorker.Popup method in netweb.clw.
So you could override the Popup method in WebHandler as well if you liked.
The call is
return(self.Script('ntAlert(''' & self.jsParm(self._utfjs(p_text)) & ''','''&self.translate('Alert')&''');',p_Send))
of course, as you can see from the above it's easiest to just add a but of code to the .Translate method in the WebHandler;
something like; (before the parent call)
if p_string = 'Alert'
Return 'Achtung!'
End
Cheers
Bruce
-
Thank you all.
Translate method is sufficient to solve my problem.
Sorry for my slow learning curve.
Best regards,
Djordje Radovanovic