Try our conversational search powered by Generative AI!

Class PageBaseLegacyExtensions

Contains extension methods for legacy functionality of PageBase that is no longer accessible on the class.

Inheritance
System.Object
PageBaseLegacyExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public static class PageBaseLegacyExtensions

Methods

Translate(PageBase, String)

Translate the given string to the current language.

Declaration
[Obsolete("Use EPiServer.Framework.Localization.LocalizationService.GetString(String) to get Translate support.")]
public static string Translate(this PageBase pageBase, string key)
Parameters
Type Name Description
PageBase pageBase

The page.

System.String key

A string to translate

Returns
Type Description
System.String

The translated string.

Remarks

GetStringByCulture(String, CultureInfo) for more information on the format of the string to translate.

TranslateFallback(PageBase, String, String)

Translate the given string to the current language. Will return supplied fallback string if no match is found.

Declaration
[Obsolete("Use EPiServer.Framework.Localization.LocalizationService.GetString(String, String) to get TranslateFallback support.")]
public static string TranslateFallback(this PageBase pageBase, string key, string fallback)
Parameters
Type Name Description
PageBase pageBase

The page.

System.String key

A string to translate

System.String fallback

The string to return if no match was found for key.

Returns
Type Description
System.String

The translated string.

Remarks

GetStringByCulture(String, CultureInfo) for more information on the format of the string to translate.

TranslateForScript(PageBase, String)

Translate the given string to the current language, in a script-safe format.

Declaration
[Obsolete("Use EPiServer.Framework.Localization.LocalizationService.GetString(String) and ScriptResourceHelper.PrepareResourceForScript(String) to get TranslateForScript support.")]
public static string TranslateForScript(this PageBase pageBase, string key)
Parameters
Type Name Description
PageBase pageBase

The page.

System.String key

A string to translate

Returns
Type Description
System.String

The translated string.

Remarks

GetStringByCulture(String, CultureInfo) for more information on the format of the string to translate.