Their are 3 Methods for developing multi-language websites:
1. Replication 2. Generalized approach 3. Using Concept of Localization and Globalization
Replization: This is basic approach used in static websites. In this approach you need to
create replica of each web page in different languages. Suppose you have 100 web pages in
your web site and you want to provide same content in 3 languages then you have to create
300 pages for it.
This is totally incorrect approach.
Generalized approach: This approach is supported in ASP.NET version 1.1, 2.0, 3.5 and
4.0. Means this approach is supported by all version of ASP.NET.
Localization and Globalization: This approach was introduced in ASP.NET version 3.5 and
Both of these approaches has their on advantages. Buth their is no disadvantage.
Now starting with Generalized approach:
First you need to have language name and their code: Language Code -------------------------------------------------------- English en-us French fr-be German de-at
To get more language code: Select Internet option in internet explorer > Select Languages Step 1: Create new website. Add Three text file and name them: a. abc.en-us.txt b. abc.fr-be.txt c. abc.de-at.txt
In this naming convention. abc: Base name en : Culture code us : Region Code txt: File Extension Step 2: Specify key and their value in these files: a. abc.en-us.txt a=This is Techsapphire b=English b. abc.fr-be.txt a=c'est www.techsapphire.in b=French c. abc.de-at.txt a=Dies ist www.techsapphire.in b=German
Step 3: Convert these files into resource files (File with extension *.resources). a. Open Visual Studio Command prompt. b. Move to web directory using command prompt. c. Use "resgen" utility to convert these files to resouces. Example: >resgen abc.en-us.txt >resgen abc.fr-be.txt >resgen abc.de-at.txt These command will create 3 files: a. abc.en-us.resources b. abc.fr-be.resources c. abc.de-at.resources
Step 4: Add Global Application Class to you web project: Global.asax
Add name space to this file: <%@ Import Namespace="System.Globalization" %> <%@ Import Namespace="System.Resources" %> <%@ Import Namespace="System.Threading" %>