Table of Contents

Class ResHelper

Namespace
CMS.Helpers
Assembly
CMS.Helpers.dll

Provides methods to provide localized resource strings

public static class ResHelper
Inheritance
object
ResHelper

Properties

Dash

Dash symbol.

[Obsolete("Property was not intended for public use and will be removed.")]
[ObsoleteSince(29, 6)]
public static string Dash { get; }

Property Value

string

Slash

Slash symbol.

[Obsolete("Property was not intended for public use and will be removed.")]
[ObsoleteSince(29, 6)]
public static string Slash { get; }

Property Value

string

Methods

GetString(string, string, bool)

Returns specified string.

public static string GetString(string stringName, string culture = null, bool useDefaultCulture = true)

Parameters

stringName string

Key of the string

culture string

Culture

useDefaultCulture bool

If true the default culture translation is used if translation in chosen culture doesn't exist

Returns

string

GetStringFormat(string, params object[])

Gets the given string and formats it with the standard String.Format method

public static string GetStringFormat(string stringName, params object[] parameters)

Parameters

stringName string

String name

parameters object[]

Parameters for the formatting

Returns

string

LocalizeString(string, string, bool, bool)

Replaces "{\(stringname\)}" expressions in given text with localized strings using given culture.

public static string LocalizeString(string inputText, string culture = null, bool encode = false, bool useDefaultCulture = true)

Parameters

inputText string

Input text with localizable expressions

culture string

Culture

encode bool

If true, translations (replacements) are HTML encoded

useDefaultCulture bool

If true the default culture translation is used if translation in chosen culture doesn't exist

Returns

string