Takes the key and returns the text in the indicated language.

Namespace:  EPiServer.Core
Assembly:  EPiServer (in EPiServer.dll) Version: 5.2.375.236

Syntax

C#
public string Translate(
	string key,
	string language
)

Parameters

key
Type: System..::.String
A simplified XPath expression
language
Type: System..::.String
The language ID of the language to translate the text into

Return Value

The translated string

Remarks

The key is typically something like "/admin/settings/heading", where the expression closely follows the folder/file/usage pattern. You can also enter a '#' to automatically constuct a path to the current file. For example when calling Translate("#heading") from the file /templates/mypage.aspx it is equivalent to calling Translate("/templates/mypage/heading").

Note: Note: If the key does not begin with a '/' or '#', the key is simply returned as the result. The reason for this behavior is to be able to use EPiServer web controls that use Translate for visible strings but you might not have translations in place or maybe do not want to translate the text.

See Also