Message Attrib Value Formatter
Inserts the values of the given attribute of the parameter
Format:
{ PARAMETER_NUMBER, attr-NAME, {DEFAULT}}
- NAME
Name of the attribute
- DEFAULT
Optional default value, if the attribute is nullContent copied to clipboard
Example:
{0} has gender {0, attr-gender, {unknown}}.Content copied to clipboard
Usage:
FORGOTTEN_BAG( PETER )
-> Peter has gender male.
FORGOTTEN_BAG( MARY )
-> Mary has gender female.Content copied to clipboard
For files storing the attribute, the name of the attribute is appended as an extension after the locale tag via “-x-attr-NAME“. E.g. for the attribute “gender”:
names_de_DE_saxiona-x-attr-gender
names_de_DE-x-attr-gender
names_de-x-attr-gender
names_en-x-attr-gender
names_fr_FR-x-attr-genderContent copied to clipboard
e.g.
subjects_en.properties
peter=male
mary=femaleContent copied to clipboard
Properties
Functions
Link copied to clipboard
open override fun format(result: StringBuilder, value: Any?, typeId: CharSequence, style: StylePart?, parameters: MessageParameters, locale: Locale, context: MessageFormatContext)
Link copied to clipboard
fun formatAttribute(result: StringBuilder, attrName: CharSequence?, value: Any?, style: StylePart?, parameters: MessageParameters, locale: Locale, context: MessageFormatContext)