Skip to content

LocalText class

namespace: Serenity   assembly: Serenity.Net.Core

Defines a localizable text resource. Contains a local text key and has implicit conversions to and from String.

public class LocalText : ILocalText
parameter description
key The local text key.

Public Members

name description
LocalText(…) Defines a localizable text resource. Contains a local text key and has implicit conversions to and from String.
static readonly Empty An empty local text instance, similar to Empty.
Key { get; } Gets the local text key.
ToString(…) Returns the translation for the current context.
const InvariantLanguageID The invariant language ID, which is an empty string.
const Literal An empty local text key, which tells that a text is shown as it is, e.g. a text that is a name. Set it as the TextKey of a text attribute, e.g. [DisplayText("Acme Corporation", TextKey = LocalText.Literal)], so that the text is neither used as a key nor registered under the key that its type implies for it, e.g. Forms.….Field. A key that is not set is different: the text then takes the implied key, so it can be translated. An empty key is also no key in the texts of the members of an enum and the items of a select editor.
static IsLocalTextKeyCandidate(…) Determines whether the specified text is a candidate for a local text key, optionally restricting to UI key prefixes.
static ResolveFromAttribute(…) Resolves the local text key and invariant text for an attribute value.
implicit operator Implicit conversion from String that creates a new instance of LocalText with the specified key.

Remarks

Creates a new LocalText instance that contains the specified local text key.

See Also