google translator
-
this is rashmi, asp.net developer .. we are developing website name: www.discareuropa.com this has to develop in 2 language English & Español we have converted english to Español..through google translator and html pages are working fine.. Problem:- if we use server side control..then we are getting problem 1st Translator language from English to Español, you will notice every thing change to Español....then put user name: admin password: admin (left side) and page will redirected to lighterBrand.aspx ..and page is auto refreshing and converting into Espanol, (as we want) ..but auto refreshing it is not stoping, ..so kindly help me how can i stop this... thanks/rashmi
-
this is rashmi, asp.net developer .. we are developing website name: www.discareuropa.com this has to develop in 2 language English & Español we have converted english to Español..through google translator and html pages are working fine.. Problem:- if we use server side control..then we are getting problem 1st Translator language from English to Español, you will notice every thing change to Español....then put user name: admin password: admin (left side) and page will redirected to lighterBrand.aspx ..and page is auto refreshing and converting into Espanol, (as we want) ..but auto refreshing it is not stoping, ..so kindly help me how can i stop this... thanks/rashmi
Think about the following scenario... While loading the page 'LighterBrand.aspx' you are calling the function convertnew('en|es'); Using following code <script language='javascript'>convertnew('en|es');</script> And in the function 'convertnew' 49th line in the JS function indexof_p = pattern.indexOf('|'); So value of 'indexof_p' will be greater than 0. So if (indexof_p == -1) will return a false and the control go to else part.
else { var psplit = pattern.split('|'); new_pattern = psplit[0]+'|'+psplit[1]; if (psplit[1] == 'en') { isen = 1; }
Here if (psplit[1] == 'en') is false because our pattern is 'en|es' So that the variable 'isen' remains blank. And in the following if conditionif (isen == 1) { thisurl = new_location; } else { thisurl = 'http://translate.google.com/translate_c?langpair=' + new_pattern + "&u=" + new_location; }
if (isen == 1) is false because 'isen' not set to 1. So else part will work. thisurl = 'http://translate.google.com/translate\_c?langpair=' + new_pattern + "&u=" + new_location; Then 'open_in_same_window' is 0. So that So control goes to following 'if'if (CanAnimate ){ msgWindow=window.open('' ,'_self','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0'); msgWindow.focus(); msgWindow.location.href = thisurl; } else { msgWindow=window.open(thisurl,'_self','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0'); }
Here In both case msgWindow.location.href = thisurl; OR msgWindow=window.open(thisurl,'_self','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0'); causes to open the page 'LighterBrand.aspx' This causes to a call to the function 'convertnew('en|es');' So that again the procedure that I explained will happen, Like a recursion Hope this will help you.EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE. How to post a question