The LanguageAPI server control lets a developer force a particular language for a Web site. You can do this by dropping the server control on the page and setting a language in the SiteLanguage
property box. You can also override site language logic by programmatically using the LanguageAPI server control to detect the browser’s language, and display the site in that language.
The LanguageSelect server control lets users view your site in the language they choose. The LanguageAPI server control, on the other hand, forces users to view a site in a particular language. For information on LanguageSelect, see LanguageSelect Server Control.
The following are Ektron-specific server control properties. You can find information about native .NET properties such as font, height, width and border style in Visual Studio® help.
Sets the site language. Runs through the IsValid function to verify that the language is an active language in the system.
Numeric value of the site language. This is the property you will use if you are using code-behind to set the sites language ID.
Example: 1036 = French
For a list of supported languages, go to Ektron Workarea > Settings > Configuration > Language Settings.
The following is a list can only be used programmatically.
Read only. Returns the current language.
Read only. Returns the current language ID.
Read only. What the default language of the site is set to. For example, the demo site is “English (Standard)”.
Read only. Returns the value that is the default language ID of the site. For example, the demo site is “1033” for English.
This method returns a string. Pass in a valid language ID and it will return the language name.
This method returns an integer. Pass in a valid language name and it will return the language ID.
This method returns a boolean. You can pass in a language ID or a string and it will tell you if the system is supporting it.
Read only. Lists all the language IDs that are activated in Ektron. For information on how to enable languages, see Working with Multi-Language Content.
Read only. Lists all the languages that are activated in Ektron.
Read only. Tells if the site supports multi-language mode.
This example uses a logo that is not managed through Ektron. It retrieves the current language from the LanguageAPI control, and uses that information to choose the logo version to display. The code-behind looks like this.
Select Case LanguageAPI1.CurrentLanguageID Case 1031 Image1.ImageUrl = "germanlogo.gif" Case 1033 Image1.ImageUrl = "englishlogo.gif" Case 1036 Image1.ImageUrl = "frenchlogo.gif" End Select