Message Declension Value Formatter
For languages that have irregular declension, a declension-provider is needed to find the declined form of a word.
Format:
{ PARAMETER_NUMBER, decl-DECLENSION_FORM, {DEFAULT_VALUE} }
PARAMETER_NUMBERNumber of the parameter which value is matched against the values of the select list
DECLENSION_FORMName of the declension form. The value of the parameter should be transformed to this declension form.
DEFAULT_VALUE
Optional default value, if the attribute is null
A general declension-provider may be based on large directories. But this is an extensive task. Therefor the default implementation will use the attributes of the LocalizedString (#43).
Example:
HIGH_RISK_OFen:
The risk of a {0} is high.de:
Das Risiko eines {0, declension-genitive, {{0}s} } ist groß.HIGH_RISK_OF( STORM )
en:
The risk of a storm is high.de:
Das Risiko eines Sturms ist groß.HIGH_RISK_OF( SPARK )
en:
The risk of a spark is high.de:
Das Risiko eines Funkens ist groß.
These subjects-strings should be defined in a separate MessageBundle where also the declension-form attribute is defined. The value of "DECLENSION_FORM" is the name of the attribute that is looked up.
For files storing the attribute, the name of the attribute is appended as extension after the locale tag via “-x-attr-declension-NAME“
subjects_en.properties
spark=spark
storm=stormNo declension for English.
subjects_de.properties
spark=Funke
storm=Sturmsubjects_de_-x-attr-decl-genitive.properties
spark=Funkens(“Sturm” has regular declension and doesn’t need a declension entry.)