In this tutorial topic you will create the page that allows visitors select a site language from a drop-down menu. After they select an option and click the submit button, the language code is written to the session variable, and the user is redirected to the list page.
Follow the next steps in order to build the page:
Open the index page in Dreamweaver.
Add a new form tag to the page from the Forms tab of the Insert
bar:

Place the cursor inside the form tag and enter
a label for the drop-down menu with the languages: "Select site language":

Next add a list/menu element by clicking on its
icon in the Forms tab of the Insert
bar:

Configure the menu: its name and its values. For
the name, change it in the Property Inspector
from select to language:

Click on the List
Values button to open the dialog box that allows adding elements
to the menu:

In the user interface that opens, enter the language
names as labels and the language codes as values. Add the following elements:

Label: English, Value: none.
Label: French, Value: fr.
Label: German, Value: ger.
Click OK to close the dialog box and add the elements.
Now add the submit button to the form. Create
a new paragraph after the drop-down menu by pressing the return
/ enter key. Then add the button by clicking on its icon in the Forms tab of the Insert
bar.

When previewed in browser, your page should look
as follows:

Change the button label to OK.
Now you must add the code that will process the form. In Dreamweaver switch to Code view (View -> Code). Then copy and paste the following code on top of the page (starting on the very first line) - select the one corresponding to your server model:
For PHP:
<?php
session_start();
if(isset($_POST['Submit'])) {
$_SESSION['language'] = $_POST['language'];
header('Location: list.php');
}
?>
For ASP_VBScript:
<%
If (request.Form("Submit") <> "") Then
SESSION("language") = request.Form("language")
response.redirect("list.asp")
End if
%>
For ColdFusion:
<cfinclude template="includes/common/KT_common.cfm">
<cfif not isDefined("SESSION.language")>
<cfset SESSION.language="">
</cfif>
<cfif isDefined("FORM.select")>
<cfset SESSION.language = FORM.select>
<cfset Request.KT_redir('list.cfm')>
</cfif>
Next you have to modify the code for the menu displaying the languages in order to display by default the current language. Locate in the index page code the HTML menu opening tag: <select name="language">. Replace the <option> tags with the following code (select the one that is appropriate for your server model):
For PHP:
<option <?php if((isset($_SESSION['language'])) &&
($_SESSION['language'] == "")) { echo "selected" ;}
?>>English</option>
<option value="fr" <?php if((isset($_SESSION['language']))
&& ($_SESSION['language'] == "fr" )) { echo "selected"
;} ?>>French</option>
<option value="ger" <?php if((isset($_SESSION['language']))
&& ($_SESSION['language'] == "ger")) { echo "selected"
;} ?>>German</option>
For ASP_VBScript:
<option <% If ((Not isnull(SESSION("language")))
and (SESSION("language") = "")) Then response.write("selected")
end if %>>English</option>
<option value="fr" <% If ((Not isnull(SESSION("language")))
and (SESSION("language") = "fr")) Then response.write("selected")
end if %>>French</option>
<option value="ger" <% If ((Not isnull(SESSION("language")))
and (SESSION("language") = "ger")) Then response.write("selected")
end if %>>German</option>
For ColdFusion:
<option value="" <cfif SESSION.language EQ "">selected</cfif>>English</option>
<option value="fr" <cfif SESSION.language EQ "fr">selected</cfif>>French</option>
<option value="ger" <cfif SESSION.language EQ "ger">selected</cfif>>German</option>
Now save the page and upload the entire site to the remote server. With
the index page opened in Dreamweaver
hit F12 to load it in a browser.
After the page loads, select the German
language from the drop-down menu:

Now click OK to load the NeXTensio
list page. It should display all the button labels in German:

Note: Through these steps only the default button labels and the error messages are translated to the selected language. Any particular site resources must be translated separately.
At this point, the application is multilingual and provides labels and error messages in the selected language. To further enhance the application, you can place the language selector in all page headers, thus allowing an easy way to switch languages straight in the page. This also means that you have to remove from the code that saves the language option into the session the line that performs the redirect to the NeXTensio list.
Caution: When performing an update of the site includes via the InterAKT Control Panel, the KT_ResourcesFunctions.inc (KT_Resources.inc on ColdFusion) file is overwritten with its newer version, causing the loss of the multilingual customization. This is why you should keep a backup copy of the file, and after every update, re-do the customization in the newer file. You might also consider regenerating the resource folders (for each language you use) in order not to miss any newly added text.