Property | Type | Description | |
---|---|---|---|
_formatter | ThreadLocalVariable |
||
_localizer | ThreadLocalVariable |
Method | Description | |
---|---|---|
Localized ( [ message ) : string |
Finds and formats a localization of the given message. If none is found, the original string is formatted.
|
|
Localized ( [ message, object arg1 ) : string | ||
Localized ( [ message, object arg1, object arg2 ) : string | ||
Passthru ( Symbol msgId, string msg ) : string |
This is the dummy translator, which is the default value of Localizer. It passes strings through untranslated. A msgId symbol cannot be handled so it is simply converted to a string.
|
|
SetFormatter ( FormatterDelegate newValue ) : SavedValue |
Sets the formatter method. Formatter is a thread-local value, but since .NET does not support inheritance of thread-local values, this method also sets the global default used by threads on which this method was never called. |
|
SetLocalizer ( LocalizerDelegate newValue ) : SavedValue |
Sets the localizer method. Localizer is a thread-local value, but since .NET does not support inheritance of thread-local values, this method also sets the global default used by threads on which this method was never called. |
|
Symbol ( Symbol resourceId, [ message, object arg1 ) : string | ||
Symbol ( Symbol resourceId, [ message, object arg1, object arg2 ) : string | ||
Symbol ( this resourceId, [ message ) : string |
This is the heart of the Localize class, which localizes and formats a string.
|
|
UseResourceManager ( ResourceManager manager, CultureInfo culture = null, string>.Func |
Uses a standard ResourceManager object to obtain translations.
|
public static Localized ( [ message ) : string | ||
message | [ | The message to translate, which may include argument
/// placeholders (e.g. "{0}"). The default formatter also accepts named
/// parameters like "{firstName}"; see |
return | string |
public static Localized ( [ message, object arg1 ) : string | ||
message | [ | |
arg1 | object | |
return | string |
public static Localized ( [ message, object arg1, object arg2 ) : string | ||
message | [ | |
arg1 | object | |
arg2 | object | |
return | string |
public static Passthru ( Symbol msgId, string msg ) : string | ||
msgId | Symbol | |
msg | string | |
return | string |
public static SetFormatter ( FormatterDelegate newValue ) : SavedValue |
||
newValue | FormatterDelegate | |
return | SavedValue |
public static SetLocalizer ( LocalizerDelegate newValue ) : SavedValue |
||
newValue | LocalizerDelegate | |
return | SavedValue |
public static Symbol ( Symbol resourceId, [ message, object arg1 ) : string | ||
resourceId | Symbol | |
message | [ | |
arg1 | object | |
return | string |
public static Symbol ( Symbol resourceId, [ message, object arg1, object arg2 ) : string | ||
resourceId | Symbol | |
message | [ | |
arg1 | object | |
arg2 | object | |
return | string |
public static Symbol ( this resourceId, [ message ) : string | ||
resourceId | this | Resource ID used to look up a translated format
/// string using the current user-defined |
message | [ | The message to be translated, which may include
/// argument placeholders (e.g. "{0}"). The default formatter also accepts
/// named parameters like "{firstName}"; see |
return | string |
public static UseResourceManager ( ResourceManager manager, CultureInfo culture = null, string>.Func |
||
manager | ResourceManager | A ResourceManager that provides access to resources (resx embedded in an assembly) |
culture | CultureInfo | |
resxNameCalculator | string>.Func | An optional function that will be
/// called when a translation is requested without providing a resource
/// key symbol. For example, if someone writes |
fallbackToPrevious | bool | If a translation was not found in the
/// specified ResourceManager and this parameter is true, the previously-
/// installed |
return | SavedValue |
public static ThreadLocalVariable |
||
return | ThreadLocalVariable |