Abstract
Constructor
Formatter lookup key must match this value
Optional
trueLabel: stringtext for 'true'
Optional
falseLabel: stringtext for 'false'
Optional
trueLabell10n: stringlocalization key for trueLabel
Optional
falseLabell10n: stringlocalization key for falseLabel
Services accessor. Note: Not passed into the constructor because this object should be created before ValidationServices itself. So it gets assigned when ValidationService.dataTypeFormatterService is assigned a value.
Provides access to services.
Protected
hasProtected
expectedThe DataTypeLookup key(s) that this class supports.
Text shown the user for a value of true. To provide localization of "true" and "false", set up ValidationServices.TextLocalizerService with text keys, cultures and translations. Then provide values for TrueLabel and FalseLabel when registering this class in the dataTypeFormatterService.
Localization key for TrueLabel. Its value will be matched to an entry made to ValidationServices.TextLocalizerService, specific to the active culture. If setup and no entry was found in TextLocalizerService, the value from the TrueLabel property is used.
Text shown the user for a value of false To provide localization of "true" and "false", set up ValidationServices.TextLocalizerService with text keys, cultures and translations. Then provide values for TrueLabel and FalseLabel when registering this class in the dataTypeFormatterService.
Localization key for FalseLabel. Its value will be matched to an entry made to ValidationServices.TextLocalizerService, specific to the active culture. If setup and no entry was found in TextLocalizerService, the value from the FalseLabel property is used.
Protected
Abstract
supportsEvaluates the parameters to determine if its format() method should handle the value with those same parameters. It should always match the DataTypeLookupKey. It does not have to evaluate the cultureID, as there are implementations where the format() function handles eve
Such as 'en-US' and 'en'
Use its format() method when true. Do not use format() when false.
Protected
prepProtected
matchingProtected
Abstract
getCreates a formatted string for the value, applying the goals of the DataTypeLookupKey and making it culture specific.
Protected
formatGenerated using TypeDoc v0.25.12
Base class for boolean localized formatters. Booleans are unusual in that they aren't normally shown, and when they are shown, they need words meaningful to the user, not "true" and "false". "yes" and "no", "on" and "off", "enabled" and "disabled" are better. This base class lets you supply a list of cultures and the text that you want to use for true and false. If not supplied, it defaults to "true" and "false". To provide localization of "true" and "false", set up ValidationServices.TextLocalizerService with text keys, cultures and translations. Then provide values for TrueLabel and FalseLabel when registering this class in the dataTypeFormatterService.