Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. google translator

google translator

Scheduled Pinned Locked Moved ASP.NET
helpcsharphtmlasp-netcom
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rashmithakur
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • R rashmithakur

      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

      S Offline
      S Offline
      Sherin Iranimose
      wrote on last edited by
      #2

      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 condition if (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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups