locked
asp.net translate pages RRS feed

  • Question

  • User1104726056 posted

    Hi,

    We have a requirement wherein we need to translate all dynamic pages(i.e database driven pages) to Chinese language. Does .NET provide any API for this, or there are third-party APIs for the same. Which third-party is best recommended?

    Do we have any sample source code that can help me out ?

    Many thanks in advance!

    Tuesday, January 12, 2010 9:46 AM

Answers

  • User78336405 posted

    Hi,

    I think you could do that with yahoo babelfish.

    The steps as follow:

    1. Grab an application id from here.
    2. Download the API
    3. Extract the archive and look for the folder: yws-2.01\Csharp\yahooSearch\Yahoo.API\
    4. Open Visual Studio and create a new website
    5. In the project explorer add the asp.net folder App_Code
    6. Copy all of the .cs files from the Yahoo.API folder to your App_Code folder, except AssemblyInfo.cs
    7. Add a new web form to your project
    8. Add a textbox and a button to your web form. Put a div tag below these with the property runat="server"
    9. In your code behind file include Yahoo.API
    10. Create a click event for your button and put in some search code.

    Code:

    YahooSearchService yahoo = new YahooSearchService();
    
    Yahoo.API.WebSearchResponse.ResultSet resultSet = yahoo.WebSearch("YOUR_APPLICATION_ID", txtQuery.Text.Trim(), "all", 10, 1, "any", true, true, "en");
    
    StringBuilder sb = new StringBuilder("");
    
    foreach (Yahoo.API.WebSearchResponse.ResultType result in resultSet.Result) {
    sb.Append("<a href=\"" + result.Url + "\">" + result.Title + "</a><br/>" + result.Summary + "<br/><br/>");
    }
    
    results.InnerHtml = sb.ToString();

     For more details, please refer:http://dotnetrush.blogspot.com/2006/08/yahoo-api-is-awesome.html .

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 14, 2010 2:19 AM

All replies

  • User236141260 posted

    You can use google translate for this purpose, i have used google translate api in my project its very good.

    They have provided sample code.


    http://code.google.com/apis/ajaxlanguage/

    http://translate.google.com/#

    to donwload you have a gmail account.

    Tuesday, January 12, 2010 11:38 AM
  • User78336405 posted

    Hi,

    I think you could do that with yahoo babelfish.

    The steps as follow:

    1. Grab an application id from here.
    2. Download the API
    3. Extract the archive and look for the folder: yws-2.01\Csharp\yahooSearch\Yahoo.API\
    4. Open Visual Studio and create a new website
    5. In the project explorer add the asp.net folder App_Code
    6. Copy all of the .cs files from the Yahoo.API folder to your App_Code folder, except AssemblyInfo.cs
    7. Add a new web form to your project
    8. Add a textbox and a button to your web form. Put a div tag below these with the property runat="server"
    9. In your code behind file include Yahoo.API
    10. Create a click event for your button and put in some search code.

    Code:

    YahooSearchService yahoo = new YahooSearchService();
    
    Yahoo.API.WebSearchResponse.ResultSet resultSet = yahoo.WebSearch("YOUR_APPLICATION_ID", txtQuery.Text.Trim(), "all", 10, 1, "any", true, true, "en");
    
    StringBuilder sb = new StringBuilder("");
    
    foreach (Yahoo.API.WebSearchResponse.ResultType result in resultSet.Result) {
    sb.Append("<a href=\"" + result.Url + "\">" + result.Title + "</a><br/>" + result.Summary + "<br/><br/>");
    }
    
    results.InnerHtml = sb.ToString();

     For more details, please refer:http://dotnetrush.blogspot.com/2006/08/yahoo-api-is-awesome.html .

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 14, 2010 2:19 AM