Episerver Translate Language xml text 4 different approaches

This is mainly a EPiServer 6 / Webforms approach.

If no pagebase object is readable:

<%= EPiServer.Core.LanguageManager.Instance.Translate("/mygadget/index/hello") %>

EPiServer.PageBase method xml/xslt path to value:

<p><%= Translate("/productlist/links/viewallcleaningpkgandacc")%></p>

Through asp.net get resource $ dot notated path to xml value

<%$ Resources: EPiServer, productlist.buttons.buyonline %>

Only valid inside server tags e.g:

<asp:Label runat="server" Text="<%$ Resources: EPiServer, productlist.buttons.buyonline %>" />

Web control episerver native (xml path to value):

<EPiServer:Translate runat="server" LocalizedText="/productlist/links/viewallcleaningpkgandacc" />

 

Leave a Reply