We recommendAustraliaIndian.comCCExoticstones.comAlvarezPigeons.comAttractionsToGo.com
 
4:54 AM EST.The ultimate source for Indian Resources in USA, Canada and UK.Sign In!
    Home
  U.S.A.
  UK
  Canada
  Software Links
  Vastu
  My Account
  About Us  
Create multi language Web Sites in asp.net
This article is based on .Net 2.0 / ASP.Net 2.0

Down Load this Project
Previous Page
  • Working With global resource files (Visual Studio 2005).


  • 1. Create a web Project Named Web,Ui
    2. Add Global Resources for Languages
            a) default         b) Spanish (es)         b) English (es-US)

    For this right click on the project and click Add->New Item
    On the "New Item" dialog box select Resources file and give name Resource.resx.
    Create resource file corresponding to other culture with corresponding name.


    2. Add Local Resources files
    Select the aspx page into design view.
    Select Tools > Generate Local Resources. Visual Studio then generates a resource file in the App_LocalResources folder, Which includes the values for every control of the page currently open in design view.
    Visual Studio generates resources for several properties of each control. The resources are always prefixed with the name of the control and postfixed with the name of the property. Visual Studio automatically generates the default resources for the controls of the page only. You must add any further culture-specific resources manually by copying the generated resources and giving them the appropriate name (for example, welcome.aspx.en-US.resx) then translate the values.


    Go to the folder App_GlobalResources click on each resource file and add a Name with Name as "Name" and corresponding values in diffrent Languages.



    3. Open the property windo for eah resource file and make sure that Build action is "Embedded Resource".



    4. Compile the project and check the bin folder for Satelite assembliesfor the corresponding culture.





  • Set the Culture and UI Culture for ASP.NET Web Page Globalization.


  • In an ASP.NET Web page, you can set to two culture values, the Culture and UICulture properties. The Culture value determines the results of culture-dependent functions, such as the date, number, and currency formatting, and so on. The UICulture value determines which resources are loaded for the page.

    1. UI culture and culture from user's browser setting.

    Users can set the UI culture and culture in their browsers. For example, in Microsoft Internet Explorer, on the Tools menu, users can click Internet Options, on the General tab, click Language, and then set their language preference. If the enableClientBasedCulture attribute of the globalization element in the Web.config file is set to true, ASP.NET can set the UI culture and culture for a Web page automatically, based on the values that are sent by a browser.

    It is not a best practice to rely exclusively on browser settings to determine the UI culture for a page. Users frequently use browsers that are not set to their preferences (for example, in an Internet cafe). You should provide a method for users to explicitly choose a language or language and culture (CultureInfo name) for the page.


    2. To set the culture and UI culture for an ASP.NET Web page declaratively

    a. Override the InitializeCulture method for the page.
    b. In the overridden method, determine which language and culture to set the page to.

    In the file "Welcome.aspx.cs", add the following code.




  • Accessing Local Resources.

    1. Implicit Localization with Local Resources
    In the page, you use a special meta attribute in the markup for the control to specify implicit localization. You do not have to explicitly specify which properties are localized.



    2. Explicit Localization



  • Accessing Global Resources.
    1. Implicit



    2. Explicit



    References:

  • ASP.NET Web Page Resources Overview
  • HttpContext.GetLocalResourceObject Method
  • HttpContext.GetGlobalResourceObject Method
  • How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization
  • Shiju Kadamala
    smathews@courtesyindia.com
    Happy Programming!.
    CourtesyIndia.com
     Home | Visitor Agreements | Privacy PolicyFAQ

      Home
      U.S.A. Links
      UK Links
      Canada Links
      Software Links
      U.S.A. Links
      Churches
      Restaurants
      Associations
      Hindu Temples
      Grocery Stores
      Garment Stores
      Jewellery Stores
      Travel Agents
      UK Links
      Restaurants
      Grocery Stores
      Churches
      Canada Links
      Churches
      Restaurants
      Grocery Stores
      Hindu Temples
      Jewellery Stores
      Garment stores
      Vastu
      Software Links
      Blogs
      Interview Center
      Tips and Tricks
      My Account
      Log In
      New Account
      Change Password
      Personal Profile
      About Us
      Site Map
      Contact Us
      Feed Back
      Add to Listing