Assembly: EPiServer.Web.WebControls (in EPiServer.Web.WebControls.dll) Version: 5.2.375.236
Syntax
| C# |
|---|
[DefaultPropertyAttribute("Text")] public class Translate : WebControl |
Remarks
Use the Translate control to translate your own strings or one of the built in strings in the /lang directory of you site. The test shown will vary by the current users chosen language (if chosen) or the system default.
The control uses the LanguageManager to translate the text. You can access the LanguageManager through code using the LanguageManager.Instance static property.
Examples
This will show the translated value for the /button/search language resource.
CopyC#<episerver:translate text="/button/search" runat="server"/>
Translating ASP Intrinsic controls
EPiServer can also translate ASP Controls like the Label web control. In the PreRender event EPiServer will search all known controls in the control hierarchy with an attribute called translate (case insensitive) and translate the textual value of the control.
<asp:button id="QuicksearchButton" runat="server" translate="/button/search" />
Inheritance Hierarchy
System.Web.UI..::.Control
System.Web.UI.WebControls..::.WebControl
EPiServer.Web.WebControls..::.Translate