C# Class i18n.NuggetLocalizer

The i18n default implementaion of the INuggetLocalizer service.
Inheritance: INuggetLocalizer
Exibir arquivo Open project: turquoiseowl/i18n

Public Properties

Property Type Description
s_internalDelimiter string[]

Protected Properties

Property Type Description
m_regexPrintfIdentifiers System.Text.RegularExpressions.Regex

Public Methods

Method Description
ConvertIdentifiersInMsgId ( string msgid ) : string

Helper for converting the C printf-style %0, %1 ... style identifiers in a formatted nugget msgid string to the .NET-style format items: {0}, {1} ...

A formatted msgid may be in the form:

Enter between %1 and %0 characters

For which we return:

Enter between {1} and {0} characters

IsNuggetFormatted ( string nugget ) : bool

Returns indication of whether the passed nugget is formatted or not.

NuggetLocalizer ( i18nSettings settings, ITextLocalizer textLocalizer ) : System
ProcessNuggets ( string entity, LanguageItem languages ) : string

Method Details

ConvertIdentifiersInMsgId() public static method

Helper for converting the C printf-style %0, %1 ... style identifiers in a formatted nugget msgid string to the .NET-style format items: {0}, {1} ...
A formatted msgid may be in the form:

Enter between %1 and %0 characters

For which we return:

Enter between {1} and {0} characters

public static ConvertIdentifiersInMsgId ( string msgid ) : string
msgid string
return string

IsNuggetFormatted() public static method

Returns indication of whether the passed nugget is formatted or not.
public static IsNuggetFormatted ( string nugget ) : bool
nugget string Subject nugget string.
return bool

NuggetLocalizer() public method

public NuggetLocalizer ( i18nSettings settings, ITextLocalizer textLocalizer ) : System
settings i18n.Domain.Concrete.i18nSettings
textLocalizer ITextLocalizer
return System

ProcessNuggets() public method

public ProcessNuggets ( string entity, LanguageItem languages ) : string
entity string
languages LanguageItem
return string

Property Details

m_regexPrintfIdentifiers protected_oe static_oe property

Regex for helping replace %0 style identifiers with {0} style ones.
protected static Regex,System.Text.RegularExpressions m_regexPrintfIdentifiers
return System.Text.RegularExpressions.Regex

s_internalDelimiter public_oe static_oe property

Sequence of chars used to delimit internal components of a Formatted nugget.
public static string[] s_internalDelimiter
return string[]