locked
Current English website into Bilingual in asp.net RRS feed

  • Question

  • User1804579801 posted

    I have developed a website using visual studio community 2013 in English with SQL server 2008 as DB. Now client requriement is Bilingual i.e it should be shown in Hindi. I searched online found some samples but I want to convert the whole website to bilingual . What is the best option for this requirement?

    Tuesday, November 19, 2019 8:47 AM

All replies

  • User-1780421697 posted

    ASP.Net offer globalization/localization, you need to specify resource files against keys, that keys are used in your code, for each culture there is specific syntax to create resource files and ASP.net auto pick the resource file by culture.

    Its bit challenging from design prospective to LTR to RTL transformation.

    Tuesday, November 19, 2019 12:03 PM
  • User409696431 posted

    Either use globalization, or duplicate the site and translate it, and publish two sites with language options to select one or the other site.  There is no easy, automatic way, and if you didn't start with the idea of using globalization, rewriting the site to do that may be slower than simply creating two sites and translating the pages (and database content, if there is any).

    Tuesday, November 19, 2019 7:51 PM
  • User288213138 posted

    Hi nagapavanich,

    I have developed a website using visual studio community 2013 in English with SQL server 2008 as DB. Now client requriement is Bilingual i.e it should be shown in Hindi. I searched online found some samples but I want to convert the whole website to bilingual . What is the best option for this requirement?

     ASP.Net can localize/Globalization an application, The globalization means that the application can render it contents based on the language preference set by a user in his or her browser. Localization involves translating a web application into different languages and cultures.

    And ASP.Net makes it easy to localize an application through the use of resource files. Resource files are xml files with .resx extension. Resources can either be a global resource, in which it is accessible throughout the site and placed in App_GlobalResources folder in a website or a local resource which is specific to a page only and is placed in App_LocalResources folder.

    More information about localize/Globalization you can refer to below link:

     https://docs.microsoft.com/en-us/previous-versions/c6zyy3s9(v=vs.140)

    http://www.ayobamiadewole.com/Blog/AspNet/Localize.aspx

    Hope this can help you.

    Best regards,

    Sam

    Wednesday, November 20, 2019 8:21 AM
  • User1804579801 posted

    Hi  Kathy,

    is https://www.translatetheweb.com option the good one. We tried but in postback it losses the language translated . Please suggest

    Wednesday, November 20, 2019 8:56 AM
  • User409696431 posted

    Google discourages automatic translations because they can give erroneous results or awkward results.  It's best to pay for a skilled translator and actually get a result that feels like it was written in the language it is being read in.

    For general guidance on how google sees multi-language sites, see https://support.google.com/webmasters/answer/182192?hl=en

    Note: "Use robots.txt to block search engines from crawling automatically translated pages on your site. Automated translations don’t always make sense and could be viewed as spam. More importantly, a poor or artificial-sounding translation can harm your site’s perception."  It would not be your goal to have to block your alternate language pages from google, so try not to rely on automatic translations.

    Wednesday, November 20, 2019 9:09 AM
  • User1804579801 posted

     URL not working . Please check 

    http://www.ayobamiadewole.com/Blog/AspNet/Localize.aspx  : The requested URL could not be retrieved.

    I created App_GlobalResources and added  Hindi.hi.resx file. Added names and value  for a login page .In design added 

    meta:resourcekey="txt_UserName"

    meta:resourcekey="lbl_loginhere"

    meta:resourcekey="txt_Password"

    meta:resourcekey="Submit"

    In page directive added 

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" Culture="auto" meta:resourcekey="PageResourcel" UICulture="auto" %>
    

    Also changed browser preference to Hindi.But not effect and login displays in english only. Restarted the system and checked .Please suggest .

    Regards,

    Pavani.

    Wednesday, November 20, 2019 9:17 AM
  • User288213138 posted

    Hi nagapavanich,

    Also changed browser preference to Hindi.But not effect and login displays in english only. Restarted the system and checked .Please suggest

    You can follow this video to how to globalize your application.

    https://www.youtube.com/watch?v=5J58w-nSohM

    If you have any question, please let me know.

    Best regards,

    Sam

    Thursday, November 21, 2019 10:38 AM
  • User409696431 posted

    For webforms, all I needed to do to have resx files work was the following:

    Add the following line in your web.config, in the system.web section:

    <globalization culture="auto" uiCulture="auto" enableClientBasedCulture="true"/>
       
    

    Create the App_GlobalResources folder (assuming you want the resx files to apply to all pages, and that you are not creating separate files for each page).  Add two resx files, the default one (in my case English) content.resx, and one for french, content.fr.resx.  The name "content" can be what you want, but it must be the same for all these files.  Of course you can add other files for other languages, using the same naming format with the proper language tag, e.g, in my example, "content.hi.resx"

    Assuming the .resx files have the following content:

    content.resx:

    Greeting Good Morning Description This is an English language web site and for content.fr.resx: Greeting Bonjour Description C'est un website en francais

    Displaying the content in the page would be done by setting the Text property as follows:

    <asp:Label runat="server" ID="Greeting" Text="<%$ Resources:content, Greeting %>" />
    
    and
    
    <asp:Label runat="server" ID="Description" Text="<%$ Resources:content, Description %>" />
    

    Change the language setting in your browser to English and then to French and you'll see the difference.  (Don't forget to restart your browser for the language preference change to take hold.)

    Saturday, November 23, 2019 8:07 AM
  • User1804579801 posted

    thank you for replay added web config tag 

    Monday, November 25, 2019 11:44 AM
  • User409696431 posted

    Did that solve your problem?  If so, please also mark my earlier reply as an answer to help others reading this thread.

    Monday, November 25, 2019 5:03 PM