locked
Language Translator RRS feed

  • Question

  • User-630381506 posted

    In my ASP.Net website, I need the total webpage static content needs to change into French from English when I click a button. How can I achieve this? Please help me.

    Tuesday, December 28, 2010 10:34 AM

Answers

  • User-519136805 posted

    Hi yadlapalli_ramesh,

    There are multiple ways to achieve this.

    1. Using Resource file generate localresource files for your local resources like labels , image urls , validation messages on the aspx pages.

    --> this approach will help you to convert your local resources into multilingual, if you also want your data stored in DB also be in multilingual than you need to change your DB structure & store data in each language.

    Note : we usually do not convert data entered by user into ML (multilingual), data that is entered by admin can be in ML.

    2. Using Database fetch each language data from DB , labels , image urls , validation messages etc...

    3. Last option is to use google translation , microsoft language api to convert whole website in multiple language by just putting language translator tool in your website.

    Now you can choose your option from above & let us know which one you want to go for.??

    Hope this will help !!!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 1, 2011 12:58 AM

All replies

  • User1392654446 posted

    http://www.labnol.org/internet/website-translation-with-google-ajax-language-ap/4367/

     

    In above link the code is given for convert launguage.try it........


    Wednesday, December 29, 2010 7:24 AM
  • User-242433875 posted

    As you are working with static text, you got 2 alternatives. First is converting the text from English to French and store all the information in Resource file. Thereafter, associate the text properties of the controls like Label etc. with it.

    Other approach would be using Google Language API to convert the text for you on fly. For this, you just need to embed a small javascript snippet that would do the job for you, no need of any RESX files. Tutorial for how to convert text using Google Translation API can be found here: http://forums.asp.net/themes/fan/forums/thread.aspx?ThreadID=1589483&PostID=4023884&PermaPostID=4023884#4023884

    Also, I would suggest to change the culture settings as well when you are modifying the page language by overwriting server event InitializeCulture().

    Wednesday, December 29, 2010 7:39 AM
  • Wednesday, December 29, 2010 9:12 AM
  • User-519136805 posted

    Hi yadlapalli_ramesh,

    There are multiple ways to achieve this.

    1. Using Resource file generate localresource files for your local resources like labels , image urls , validation messages on the aspx pages.

    --> this approach will help you to convert your local resources into multilingual, if you also want your data stored in DB also be in multilingual than you need to change your DB structure & store data in each language.

    Note : we usually do not convert data entered by user into ML (multilingual), data that is entered by admin can be in ML.

    2. Using Database fetch each language data from DB , labels , image urls , validation messages etc...

    3. Last option is to use google translation , microsoft language api to convert whole website in multiple language by just putting language translator tool in your website.

    Now you can choose your option from above & let us know which one you want to go for.??

    Hope this will help !!!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, January 1, 2011 12:58 AM
  • User1223523322 posted

    I tried creating multiple resx file for all the static content on my pages. But what I would like to accomplish is also to translate the dynamic content using some translation engine if the text is not found in resx file. I am open to using bing or google api to do the translation. But I am not sure how to di this. Could you please throw some light on that?

    Monday, April 4, 2011 12:16 PM
  • User128097732 posted

    My application is developed in .Net 4.0 and sql server. I want to convert my website into multilingual and I used google API to achieve this.

    I have added GoogleTranslateAPI.dll in my solution. When My code come to line below.

     string translated = Translator.Translate("Hello",Language.English ,Language.Japanese); it generate and exception message
    
    
    
    
    Translate failed!Google.API.Translate.TranslateException:
     request:"http://ajax.googleapis.com/ajax/services/language/translate?langpair=en%7Cja&format?=text&q=Hello&v=1.0"
     ---> Google.API.GoogleAPIException: Failed to get response. ---> System.Net.WebException: Unable to connect to the
     remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not
     properly respond after a period of time, or established connection failed because connected host has failed to respond 
    209.85.175.95:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
     at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, 
    ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace
     --- at System.Net.HttpWebRequest.GetResponse() at Google.API.RequestUtility.GetResponseData[T](WebRequest request)
     --- End of inner exception stack trace --- at Google.API.RequestUtility.GetResponseData[T](WebRequest request) 
    at Google.API.Translate.Translator.Translate(String text, String from, String to, TranslateFormat format) --- End of inner exception
     stack trace --- at Google.API.Translate.Translator.Translate(String text, String from, String to, TranslateFormat format) at
     Google.API.Translate.Translator.Translate(String text, Language from, Language to, TranslateFormat format)
    
    
    Please assist....

     

    Tuesday, August 9, 2011 2:31 AM