Closed mttrbrts closed 5 years ago
My inclination is:
enum TemporalUnit {
@localization_en( 'day', 'days')
@localization_fr( 'jour', 'jours')
o DAY
//...
}
With the second key (plural) optional.
Note that in its current state Composer doesn't support multiple decorators with the same name on the same element.
Also, note that while an external localization file would be very nice for translation purposes it would be tricky to make it work with models that are loaded from URLs.
Should this issue moved to https://github.com/hyperledger/composer-concerto ?
Yes, it should ...
To support textual variants of the same enumeration element in a model, the model definition should allow annotations that enumerate text alternatives.
The annotation could also be used to capture language-specific variants of a model element.
This would clean up model enumerations so that they only need to define a single element per semantic element. Logic that operates on enumerations (for example
match
statements in Ergo) would then also not need to match multiple valuesWhere an annotation is not provided, the String value of the element would be used.
For example:
We could even consider something like a
.language
file to externalize language definitions, e.g.and in
model.en.language
alternative
,alternativeText
,verbalization
,localization
,textOptions
etc..)