Skip navigation

Localize the web page based on browser default language

Localizing the web pages based on browser default selected language.  In this example, languages en-us and de are considered.  To use the following code, the following steps will assit,

1. Create vb.net web application project name it as project1.

2. Add two resource files namely string.en-us.resx and string.de.resx. Note: The resourse files are added by right click on project and select Add new item.  Select Assembly resource file template from the right pane.

3. Open the resource file and give value for name & value pair. The name will be common for the both the files since this name will be referred in the pages.  In example, the name is used as 'subhead4'. 

4.copy the code in the code in appropriate location.

5. Build the solution. Two folders will be created under bin folder of the project such as de and en-us.  The dll file project1.resources.dll will be created in both the folders.

6. Change Browser default language to de and en-us and see the changes in UI.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish